# -*- coding: utf-8 -*-
# 通联数据机密
# --------------------------------------------------------------------
# 通联数据股份公司版权所有 © 2013-2019
#
# 注意：本文所载所有信息均属于通联数据股份公司资产。本文所包含的知识和技术概念均属于
# 通联数据产权，并可能由中国、美国和其他国家专利或申请中的专利所覆盖，并受商业秘密或
# 版权法保护。
# 除非事先获得通联数据股份公司书面许可，严禁传播文中信息或复制本材料。
#
# DataYes CONFIDENTIAL
# --------------------------------------------------------------------
# Copyright © 2013-2019 DataYes, All Rights Reserved.
#
# NOTICE: All information contained herein is the property of DataYes
# Incorporated. The intellectual and technical concepts contained herein are
# proprietary to DataYes Incorporated, and may be covered by China, U.S. and
# Other Countries Patents, patents in process, and are protected by trade
# secret or copyright law.
# Dissemination of this information or reproduction of this material is
# strictly forbidden unless prior written permission is obtained from DataYes.

from . import api_base
try:
    from StringIO import StringIO
except:
    from io import StringIO
import pandas as pd
import sys
from datetime import datetime
from .api_base import get_cache_key, get_data_from_cache, put_data_in_cache, pretty_traceback
import inspect
try:
    unicode
except:
    unicode = str

__doc__="通联数据"
def __SysCodeNewGet(codeTypeID = "", useType = "", valueCD = "", field = "", pandas = "1"):
    """
    各api接口有枚举值特性的输出列，如getSecID输出项exchangeCD值，编码分别代表的是什么市场，所有枚举值都可以在这个接口获取。
    
    :param codeTypeID: 输入获知的参数分类ID，可以查询到这个参数分类下所有枚举值，非必须输入项,可以是列表,可空
    :param useType: 输入获知的参数取用列名,可以查询到有该类编码的所有枚举值,非必须输入项,可以是列表,可空
    :param valueCD: 输入获知的参数下常量值，可以查询到这个常量值的说明，非必须输入项,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSysCodeNew.csv?ispandas=1&') 
    requestString.append("codeTypeID=")
    if hasattr(codeTypeID,'__iter__') and not isinstance(codeTypeID, str):
        if len(codeTypeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = codeTypeID
            requestString.append(None)
        else:
            requestString.append(','.join(codeTypeID))
    else:
        requestString.append(codeTypeID)
    requestString.append("&useType=")
    if hasattr(useType,'__iter__') and not isinstance(useType, str):
        if len(useType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = useType
            requestString.append(None)
        else:
            requestString.append(','.join(useType))
    else:
        requestString.append(useType)
    requestString.append("&valueCD=")
    if hasattr(valueCD,'__iter__') and not isinstance(valueCD, str):
        if len(valueCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = valueCD
            requestString.append(None)
        else:
            requestString.append(','.join(valueCD))
    else:
        requestString.append(valueCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SysCodeNewGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SysCodeNewGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'codeTypeID', u'useType', u'valueCD', u'valueName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'useType': 'str','valueCD': 'str','valueName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __TypeDescriptionGet(typeID = "", typeName = "", isNew = "", industry = "", field = "", pandas = "1"):
    """
    获取各级分类的行业简介。
    
    :param typeID: 分类代码,可以是列表,typeID、typeName至少选择一个
    :param typeName: 分类名称,可以是列表,typeID、typeName至少选择一个
    :param isNew: 是否最新,可以是列表,可空
    :param industry: 所属行业分类标准,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getTypeDescription.csv?ispandas=1&') 
    requestString.append("typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&typeName=")
    if hasattr(typeName,'__iter__') and not isinstance(typeName, str):
        if len(typeName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeName
            requestString.append(None)
        else:
            requestString.append(','.join(typeName))
    else:
        requestString.append(typeName)
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&industry=")
    if hasattr(industry,'__iter__') and not isinstance(industry, str):
        if len(industry) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industry
            requestString.append(None)
        else:
            requestString.append(','.join(industry))
    else:
        requestString.append(industry)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__TypeDescriptionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__TypeDescriptionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeID', u'typeName', u'isNew', u'industry', u'description', u'descriptionEn', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeID': 'str','typeName': 'str','industry': 'str','description': 'str','descriptionEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PartyIDGet(partyID = "", partyName = "", field = "", pandas = "1"):
    """
    输入一个或多个机构名称，获取机构ID，机构在数据结构中的一个唯一识别的编码（含科创板）。
    
    :param partyID: 通联编制的发行机构代码。,可以是列表,partyID、partyName至少选择一个
    :param partyName: 输入一个机构名称，如"平安银行"。支持模糊查询。,partyID、partyName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getPartyID.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    if not isinstance(partyName, str) and not isinstance(partyName, unicode):
        partyName = str(partyName)

    requestString.append("&partyName=%s"%(partyName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PartyIDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PartyIDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'partyFullName', u'partyFullNameEn', u'partyShortName', u'partyShortNameEn', u'officeAddr', u'primeOperating', u'partyNatureCD', u'instStatus', u'isIssBond']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyFullName': 'str','partyFullNameEn': 'str','partyShortName': 'str','partyShortNameEn': 'str','officeAddr': 'str','primeOperating': 'str','partyNatureCD': 'str','isIssBond': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecHaltGet(secID = "", ticker = "", beginDate = "", endDate = "", listStatusCD = "", assetClass = "", field = "", pandas = "1"):
    """
    输入证券ID或证券交易代码，获取证券停牌起始时间、截止时间。也可以根据日期范围查询出在这段时间内持续停牌的证券，例如起始日期、结束日期设置为同一天，可以查询出当天停牌的所有证券。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券交易代码，如'000001',可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 按停牌日期查询的起始日期，输入格式“YYYYMMDD”。例：输入‘20190409’，返回在2019年4月9日及之后处于停牌状态的证券。,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 按停牌日期查询的截止日期，输入格式“YYYYMMDD”。例：输入日期‘20190409’，返回在2019年4月9日及之前存在停牌的证券。若无输入值，默认获取从数据开始日期到现在所有存在过的停牌记录。,secID、ticker、beginDate、endDate至少选择一个
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。,可以是列表,可空
    :param assetClass: 通联编制的证券类别编码。例如，E-股票；B-债券；F-基金；FU-期货等。可以使用DataAPI.SysCodeGet接口获取所有取值，codeTypeID=10001。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecHalt.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    requestString.append("&assetClass=")
    if hasattr(assetClass,'__iter__') and not isinstance(assetClass, str):
        if len(assetClass) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = assetClass
            requestString.append(None)
        else:
            requestString.append(','.join(assetClass))
    else:
        requestString.append(assetClass)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecHaltGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecHaltGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'haltBeginTime', u'haltEndTime', u'ticker', u'secShortName', u'exchangeCD', u'listStatusCD', u'delistDate', u'assetClass']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','haltBeginTime': 'str','haltEndTime': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','listStatusCD': 'str','assetClass': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecIDGet(partyID = "", ticker = "", cnSpell = "", assetClass = "", exchangeCD = "", listStatusCD = "", field = "", pandas = "1"):
    """
    输入一个或多个证券交易代码，获取证券ID，证券在数据结构中的一个唯一识别的编码；同时可以获取输入证券的基本上市信息，如交易市场，上市状态，交易币种，ISIN编码等（含科创板）。
    
    :param partyID: 机构ID，assetClass为股票和债券时，是发行人的机构ID；assetClass为基金时，是基金管理人的机构ID；assetClass为指数时，是指数发布机构ID。,可以是列表,partyID、ticker、cnSpell、assetClass至少选择一个
    :param ticker: 证券在交易所的交易代码，可输入一个或多个，用","分隔，如"000001"、"000001,600001"。,可以是列表,partyID、ticker、cnSpell、assetClass至少选择一个
    :param cnSpell: 通过输入证券简称拼音的方式，获取证券交易代码等信息，拼音以使用汉字拼音首位连接，如“平安银行”，即“PAYH”。,可以是列表,partyID、ticker、cnSpell、assetClass至少选择一个
    :param assetClass: 证券类型，可供选择类型：E 股票,B 债券,F 基金,IDX 指数,FU 期货,OP 期权；默认为 E。,partyID、ticker、cnSpell、assetClass至少选择一个
    :param exchangeCD: 交易市场,可以是列表,可空
    :param listStatusCD: 上市状态：L-上市，S-暂停，DE-终止上市，UN-未上市。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecID.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&cnSpell=")
    if hasattr(cnSpell,'__iter__') and not isinstance(cnSpell, str):
        if len(cnSpell) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = cnSpell
            requestString.append(None)
        else:
            requestString.append(','.join(cnSpell))
    else:
        requestString.append(cnSpell)
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecIDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecIDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'cnSpell', u'exchangeCD', u'assetClass', u'listStatusCD', u'listDate', u'transCurrCD', u'ISIN', u'partyID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','cnSpell': 'str','exchangeCD': 'str','assetClass': 'str','listStatusCD': 'str','transCurrCD': 'str','ISIN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecTradeTimeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取期货合约在上市交易场所的交易时间。默认查看过去1年。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券交易代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，默认当前日期加1年，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecTradeTime.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecTradeTimeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecTradeTimeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'tradeDate', u'tradeTime', u'ticker', u'secShortName', u'exchangeCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','tradeTime': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TradeCalGet(exchangeCD, beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    记录了上海证券交易所，深圳证券交易所，中国银行间市场，大连商品交易所，郑州商品交易所，上海期货交易所，中国金融期货交易所和香港交易所等交易所在日历日期当天是否开市的信息，其中上证、深证记录了自成立以来的全部日期是否开始信息。各交易日节假日安排通知发布当天即更新数据。
    
    :param exchangeCD: 证券交易所。可选：XSHG，XSHE，CCFX，XDCE，XSGE，XZCE，XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，CCFX表示中国金融期货交易所，XDCE表示大连商品交易所，XSGE表示上海期货交易所，XZCE表示郑州商品交易所，XHKG表示香港证券交易所。可同时输入多个证券交易所,可以是列表
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 日期当天是否开市。0表示否，1表示是,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getTradeCal.csv?ispandas=1&') 
    requestString.append("exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TradeCalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TradeCalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'calendarDate', u'isOpen', u'prevTradeDate', u'isWeekEnd', u'isMonthEnd', u'isQuarterEnd', u'isYearEnd']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IndustryGet(industryVersion = "", industryVersionCD = "", industryLevel = "", isNew = "", prntIndustryID = "", industryName = "", industryID = "", field = "", pandas = "1"):
    """
    获取行业分类目录，包含行业编码、行业代码、行业标准编码、行业层级、上一级行业编码、是否最新等。行业分类标准目前提供：证监会行业；申万行业；中信行业；中证行业；恒生行业；战略性新兴产业。
    
    :param industryVersion: 行业分类标准版本,industryVersion、industryVersionCD至少选择一个
    :param industryVersionCD: 行业分类标准数字编码，010301-证监会行业V2012；010303-申万行业分类；010306-恒生行业；010314-中证行业分类（2016版）；010317-中信行业分类；010319-战略性新兴产业(2018),可以是列表,industryVersion、industryVersionCD至少选择一个
    :param industryLevel: 行业所在层级,可以是列表,可空
    :param isNew: 当前是否有效,可空
    :param prntIndustryID: 上一级行业的数字编码，可使用此参数获取某一个行业的所有子行业,可以是列表,可空
    :param industryName: 行业名称，支持模糊查询,可空
    :param industryID: 通联编制的行业分类编码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getIndustry.csv?ispandas=1&') 
    if not isinstance(industryVersion, str) and not isinstance(industryVersion, unicode):
        industryVersion = str(industryVersion)

    requestString.append("industryVersion=%s"%(industryVersion))
    requestString.append("&industryVersionCD=")
    if hasattr(industryVersionCD,'__iter__') and not isinstance(industryVersionCD, str):
        if len(industryVersionCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryVersionCD
            requestString.append(None)
        else:
            requestString.append(','.join(industryVersionCD))
    else:
        requestString.append(industryVersionCD)
    requestString.append("&industryLevel=")
    if hasattr(industryLevel,'__iter__') and not isinstance(industryLevel, str):
        if len(industryLevel) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryLevel
            requestString.append(None)
        else:
            requestString.append(','.join(industryLevel))
    else:
        requestString.append(industryLevel)
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    requestString.append("&prntIndustryID=")
    if hasattr(prntIndustryID,'__iter__') and not isinstance(prntIndustryID, str):
        if len(prntIndustryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = prntIndustryID
            requestString.append(None)
        else:
            requestString.append(','.join(prntIndustryID))
    else:
        requestString.append(prntIndustryID)
    if not isinstance(industryName, str) and not isinstance(industryName, unicode):
        industryName = str(industryName)

    requestString.append("&industryName=%s"%(industryName))
    requestString.append("&industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IndustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IndustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'industryVersionCD', u'industryVersion', u'industry', u'industryID', u'industrySymbol', u'industryName', u'industryLevel', u'isNew', u'indexSymbol', u'prntIndustryID', u'beginDate', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industryVersionCD': 'str','industryVersion': 'str','industry': 'str','industryID': 'str','industrySymbol': 'str','industryName': 'str','indexSymbol': 'str','prntIndustryID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecTypeRelGet(secID = "", ticker = "", typeID = "", field = "", pandas = "1"):
    """
    获取证券板块分类的成分信息，包含沪深股票、指数等。证券分类编码可通过getSecType获取。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取，可查询该证券属于哪些分类的成分，支持输入多个证券ID。,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param typeID: 通联编制的板块分类编码，可获取该分类下全部成分,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecTypeRel.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(typeID, str) and not isinstance(typeID, unicode):
        typeID = str(typeID)

    requestString.append("&typeID=%s"%(typeID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecTypeRelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecTypeRelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeID', u'typeName', u'secID', u'ticker', u'exchangeCD', u'secShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeID': 'str','typeName': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquInfoGet(ticker = "", field = "", pandas = "1"):
    """
    根据拼音或股票代码，匹配股票代码、名称。包含正在上市的全部沪深和新三板股票（含科创板）。
    
    :param ticker: 可以输入证券交易代码，如'688001',可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getEquInfo.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'exchangeCD', u'shortNM']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecTypeRegionRelGet(secID = "", ticker = "", typeID = "", typeIDLV1 = "", field = "", pandas = "1"):
    """
    获取沪深股票地域分类，以注册地所在行政区域为标准。详细划分可在商品“地域分类”获取。
    
    :param secID: 输入证券ID，可查询该证券属于哪些分类的成分，支持输入多个证券ID。,可以是列表,可空
    :param ticker: 输入证券交易代码，可查询该证券交易代码属于哪些分类的成分，支持输入多个证券交易代码。,可以是列表,可空
    :param typeID: 输入某个证券分类的15位或18位typeID值（分类的子节点；输入项最细到地级市的typeID），可获取该子节点分类下全部成分。分类可在api如getSecType获取，地域类typeID以101001004开头。,可空
    :param typeIDLV1: 输入某个证券分类的15位typeID值（分类的子节点；输入项为省及直辖市的typeID），可获取该子节点分类下全部成分。分类可在api如getSecType获取，地域类typeID以101001004开头。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecTypeRegionRel.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(typeID, str) and not isinstance(typeID, unicode):
        typeID = str(typeID)

    requestString.append("&typeID=%s"%(typeID))
    if not isinstance(typeIDLV1, str) and not isinstance(typeIDLV1, unicode):
        typeIDLV1 = str(typeIDLV1)

    requestString.append("&typeIDLV1=%s"%(typeIDLV1))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecTypeRegionRelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecTypeRegionRelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeID', u'typeName', u'secID', u'ticker', u'exchangeCD', u'secShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeID': 'str','typeName': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecTypeGet(typeID = "", typeName = "", parentID = "", typeLevel = "", field = "", pandas = "1"):
    """
    获取证券板块分类列表，一级分类包含沪深股票、指数、期权等，每个分类又细分有不同类型；可一次获取全部分类。
    
    :param typeID: 分类ID，通联分类编码，每三位一个层级,可以是列表,可空
    :param typeName: 分类名称，支持模糊查询,可以是列表,可空
    :param parentID: 父节点，只输入该参数可获取该节点下所有子节点,可以是列表,可空
    :param typeLevel: 分类所在级别,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecType.csv?ispandas=1&') 
    requestString.append("typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&typeName=")
    if hasattr(typeName,'__iter__') and not isinstance(typeName, str):
        if len(typeName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeName
            requestString.append(None)
        else:
            requestString.append(','.join(typeName))
    else:
        requestString.append(typeName)
    requestString.append("&parentID=")
    if hasattr(parentID,'__iter__') and not isinstance(parentID, str):
        if len(parentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = parentID
            requestString.append(None)
        else:
            requestString.append(','.join(parentID))
    else:
        requestString.append(parentID)
    requestString.append("&typeLevel=")
    if hasattr(typeLevel,'__iter__') and not isinstance(typeLevel, str):
        if len(typeLevel) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeLevel
            requestString.append(None)
        else:
            requestString.append(','.join(typeLevel))
    else:
        requestString.append(typeLevel)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecTypeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecTypeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeID', u'typeName', u'parentID', u'typeLevel']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeID': 'str','typeName': 'str','parentID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecTypeRegionGet(typeID = "", typeName = "", parentID = "", typeLevel = "", field = "", pandas = "1"):
    """
    获取中国地域分类，以行政划分为标准。
    
    :param typeID: 分类ID，通联分类编码，每三位一个层级,可以是列表,可空
    :param typeName: 分类名称，支持模糊查询,可以是列表,可空
    :param parentID: 父节点，只输入该参数可获取该节点下所有子节点,可以是列表,可空
    :param typeLevel: 分类所在级别,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecTypeRegion.csv?ispandas=1&') 
    requestString.append("typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&typeName=")
    if hasattr(typeName,'__iter__') and not isinstance(typeName, str):
        if len(typeName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeName
            requestString.append(None)
        else:
            requestString.append(','.join(typeName))
    else:
        requestString.append(typeName)
    requestString.append("&parentID=")
    if hasattr(parentID,'__iter__') and not isinstance(parentID, str):
        if len(parentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = parentID
            requestString.append(None)
        else:
            requestString.append(','.join(parentID))
    else:
        requestString.append(parentID)
    requestString.append("&typeLevel=")
    if hasattr(typeLevel,'__iter__') and not isinstance(typeLevel, str):
        if len(typeLevel) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeLevel
            requestString.append(None)
        else:
            requestString.append(','.join(typeLevel))
    else:
        requestString.append(typeLevel)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecTypeRegionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecTypeRegionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeID', u'typeName', u'parentID', u'typeLevel']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeID': 'str','typeName': 'str','parentID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SysCodeGet(codeTypeID = "", valueCD = "", field = "", pandas = "1"):
    """
    各api接口有枚举值特性的输出列，如getSecID输出项exchangeCD值，编码分别代表的是什么市场，所有枚举值都可以在这个接口获取。
    
    :param codeTypeID: 输入获知的参数分类ID，可以查询到这个参数分类下所有枚举值，非必须输入项,可以是列表,可空
    :param valueCD: 输入获知的参数下常量值，可以查询到这个常量值的说明，非必须输入项,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSysCode.csv?ispandas=1&') 
    requestString.append("codeTypeID=")
    if hasattr(codeTypeID,'__iter__') and not isinstance(codeTypeID, str):
        if len(codeTypeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = codeTypeID
            requestString.append(None)
        else:
            requestString.append(','.join(codeTypeID))
    else:
        requestString.append(codeTypeID)
    requestString.append("&valueCD=")
    if hasattr(valueCD,'__iter__') and not isinstance(valueCD, str):
        if len(valueCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = valueCD
            requestString.append(None)
        else:
            requestString.append(','.join(valueCD))
    else:
        requestString.append(valueCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SysCodeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SysCodeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'codeTypeID', u'valueCD', u'valueName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'valueCD': 'str','valueName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def WorkingCalGet(beginDate = "", endDate = "", isWork = "", prevWorkDate = "", field = "", pandas = "1"):
    """
    记录节假日安排数据。
    
    :param beginDate: 起始查询日期，输入格式“YYYYMMDD”,beginDate、endDate、isWork、prevWorkDate至少选择一个
    :param endDate: 截止查询日期，输入格式“YYYYMMDD”,beginDate、endDate、isWork、prevWorkDate至少选择一个
    :param isWork: 是否为工作日，1-是，0-否,可以是列表,beginDate、endDate、isWork、prevWorkDate至少选择一个
    :param prevWorkDate: 前一工作日,可以是列表,beginDate、endDate、isWork、prevWorkDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getWorkingCal.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&isWork=")
    if hasattr(isWork,'__iter__') and not isinstance(isWork, str):
        if len(isWork) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isWork
            requestString.append(None)
        else:
            requestString.append(','.join(isWork))
    else:
        requestString.append(isWork)
    requestString.append("&prevWorkDate=")
    if hasattr(prevWorkDate,'__iter__') and not isinstance(prevWorkDate, str):
        if len(prevWorkDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = prevWorkDate
            requestString.append(None)
        else:
            requestString.append(','.join(prevWorkDate))
    else:
        requestString.append(prevWorkDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'WorkingCalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'WorkingCalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'calendarDate', u'isWork', u'prevWorkDate', u'weekStartDate', u'weekEndDate', u'monthStartDate', u'monthEndDate', u'quarterStartDate', u'quarterEndDate', u'yearStartDate', u'yearEndDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecChgHistoryGet(secID = "", ticker = "", endDate = "", chgTypeCD = "", history = "", field = "", pandas = "1"):
    """
    记录股票简称及代码变更历史，包括变更起始时间等（含科创板）。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。输入可查询该证券的历史变更情况。,可以是列表,secID、ticker、endDate、chgTypeCD、history至少选择一个
    :param ticker: 证券在证券市场通用的交易代码（目前的最新代码）。输入可查询该证券的历史变更情况。,可以是列表,secID、ticker、endDate、chgTypeCD、history至少选择一个
    :param endDate: 历史简称/代码的最后使用日期，输入可查询到变更前的历史简称/代码。,可以是列表,secID、ticker、endDate、chgTypeCD、history至少选择一个
    :param chgTypeCD: 变更类型代码，0101-简称变更，0111-代码变更,可以是列表,secID、ticker、endDate、chgTypeCD、history至少选择一个
    :param history: 历史证券代码或简称，输入可查询到目前的最新代码与简称以及变更日期,可以是列表,secID、ticker、endDate、chgTypeCD、history至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecChgHistory.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&endDate=")
    if hasattr(endDate,'__iter__') and not isinstance(endDate, str):
        if len(endDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = endDate
            requestString.append(None)
        else:
            requestString.append(','.join(endDate))
    else:
        requestString.append(endDate)
    requestString.append("&chgTypeCD=")
    if hasattr(chgTypeCD,'__iter__') and not isinstance(chgTypeCD, str):
        if len(chgTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = chgTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(chgTypeCD))
    else:
        requestString.append(chgTypeCD)
    requestString.append("&history=")
    if hasattr(history,'__iter__') and not isinstance(history, str):
        if len(history) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = history
            requestString.append(None)
        else:
            requestString.append(','.join(history))
    else:
        requestString.append(history)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecChgHistoryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecChgHistoryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'changType', u'value', u'beginDate', u'endDate', u'secShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','changType': 'str','value': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def InstNameChgGet(partyID = "", secID = "", secShortName = "", ticker = "", newName = "", oldName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取公司名称变更的日期以及变更前后的名称。
    
    :param partyID: 机构内部ID,可以是列表,partyID、secID、secShortName、ticker至少选择一个
    :param secID: 证券内部ID,可以是列表,partyID、secID、secShortName、ticker至少选择一个
    :param secShortName: 证券简称,partyID、secID、secShortName、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,partyID、secID、secShortName、ticker至少选择一个
    :param newName: 更名后名称,可空
    :param oldName: 更名前名称,可空
    :param beginDate: 变更开始时间,可空
    :param endDate: 变更结束时间,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getInstNameChg.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(newName, str) and not isinstance(newName, unicode):
        newName = str(newName)

    requestString.append("&newName=%s"%(newName))
    if not isinstance(oldName, str) and not isinstance(oldName, unicode):
        oldName = str(oldName)

    requestString.append("&oldName=%s"%(oldName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'InstNameChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'InstNameChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'secShortName', u'ticker', u'newName', u'oledName', u'chgDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','newName': 'str','oledName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecSymbolGet(mapTypeCD = "", secID = "", ticker = "", secMapTicker = "", secMapID = "", field = "", pandas = "1"):
    """
    获取证券在市场上相关代码信息。
    
    :param mapTypeCD: 对应代码类型,0151-港股转板股份代码映射,0150-港股临时交易代码,0152-港股双币双股代码关联,0601-期货主力合约与月合约映射,0151-港股转板上市对应,0407-通联商品指数代码关联,可以是列表,mapTypeCD至少选择一个
    :param secID: 证券内部ID,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param secMapTicker: 对应交易代码,可以是列表,可空
    :param secMapID: 对应证券ID,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getSecSymbol.csv?ispandas=1&') 
    requestString.append("mapTypeCD=")
    if hasattr(mapTypeCD,'__iter__') and not isinstance(mapTypeCD, str):
        if len(mapTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = mapTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(mapTypeCD))
    else:
        requestString.append(mapTypeCD)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secMapTicker=")
    if hasattr(secMapTicker,'__iter__') and not isinstance(secMapTicker, str):
        if len(secMapTicker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secMapTicker
            requestString.append(None)
        else:
            requestString.append(','.join(secMapTicker))
    else:
        requestString.append(secMapTicker)
    requestString.append("&secMapID=")
    if hasattr(secMapID,'__iter__') and not isinstance(secMapID, str):
        if len(secMapID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secMapID
            requestString.append(None)
        else:
            requestString.append(','.join(secMapID))
    else:
        requestString.append(secMapID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecSymbolGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecSymbolGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'mapTypeCD', u'mapType', u'mapSymbolEXCD', u'secTicker', u'secMapID', u'secMapSecName', u'beginDate', u'endDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','mapTypeCD': 'str','mapType': 'str','mapSymbolEXCD': 'str','secTicker': 'str','secMapID': 'str','secMapSecName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TypeListGet(industry = "", typeID = "", typeSymbol = "", typeName = "", typeParentID = "", industryLevel = "", industryVersion = "", isNew = "", field = "", pandas = "1"):
    """
    获取针对机构、证券的行业分类说明，覆盖证监会行业2012、申万行业、中证行业、GICS行业、沪深市场板块等分类体系。
    
    :param industry: 所属行业分类标准,可以是列表,industry至少选择一个
    :param typeID: 分类ID,可以是列表,可空
    :param typeSymbol: 分类代码,可以是列表,可空
    :param typeName: 分类名称,可以是列表,可空
    :param typeParentID: 父节点,可以是列表,可空
    :param industryLevel: 行业级别,可以是列表,可空
    :param industryVersion: 所属行业分类版本,可空
    :param isNew: 是否最新,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getTypeList.csv?ispandas=1&') 
    requestString.append("industry=")
    if hasattr(industry,'__iter__') and not isinstance(industry, str):
        if len(industry) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industry
            requestString.append(None)
        else:
            requestString.append(','.join(industry))
    else:
        requestString.append(industry)
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&typeSymbol=")
    if hasattr(typeSymbol,'__iter__') and not isinstance(typeSymbol, str):
        if len(typeSymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeSymbol
            requestString.append(None)
        else:
            requestString.append(','.join(typeSymbol))
    else:
        requestString.append(typeSymbol)
    requestString.append("&typeName=")
    if hasattr(typeName,'__iter__') and not isinstance(typeName, str):
        if len(typeName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeName
            requestString.append(None)
        else:
            requestString.append(','.join(typeName))
    else:
        requestString.append(typeName)
    requestString.append("&typeParentID=")
    if hasattr(typeParentID,'__iter__') and not isinstance(typeParentID, str):
        if len(typeParentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeParentID
            requestString.append(None)
        else:
            requestString.append(','.join(typeParentID))
    else:
        requestString.append(typeParentID)
    requestString.append("&industryLevel=")
    if hasattr(industryLevel,'__iter__') and not isinstance(industryLevel, str):
        if len(industryLevel) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryLevel
            requestString.append(None)
        else:
            requestString.append(','.join(industryLevel))
    else:
        requestString.append(industryLevel)
    if not isinstance(industryVersion, str) and not isinstance(industryVersion, unicode):
        industryVersion = str(industryVersion)

    requestString.append("&industryVersion=%s"%(industryVersion))
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TypeListGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TypeListGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeID', u'typeSymbol', u'typeName', u'typeParentID', u'position', u'begDate', u'endDate', u'isNew', u'industry', u'industryVersion', u'industryLevel']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeID': 'str','typeSymbol': 'str','typeName': 'str','typeParentID': 'str','industry': 'str','industryVersion': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CountryGet(CounCD2 = "", CounCD3 = "", CounNum = "", CounShortNameCN = "", field = "", pandas = "1"):
    """
    获取采用ISO标准（ISO 3166-1）国家代码记录的国家地区信息，信息包含二位字母、三位字母、数字三种形式。
    
    :param CounCD2: 两位国家代码,可以是列表,可空
    :param CounCD3: 三位国家代码,可以是列表,可空
    :param CounNum: 国家数字编号,可以是列表,可空
    :param CounShortNameCN: 国家简称,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getCountry.csv?ispandas=1&') 
    requestString.append("CounCD2=")
    if hasattr(CounCD2,'__iter__') and not isinstance(CounCD2, str):
        if len(CounCD2) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = CounCD2
            requestString.append(None)
        else:
            requestString.append(','.join(CounCD2))
    else:
        requestString.append(CounCD2)
    requestString.append("&CounCD3=")
    if hasattr(CounCD3,'__iter__') and not isinstance(CounCD3, str):
        if len(CounCD3) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = CounCD3
            requestString.append(None)
        else:
            requestString.append(','.join(CounCD3))
    else:
        requestString.append(CounCD3)
    requestString.append("&CounNum=")
    if hasattr(CounNum,'__iter__') and not isinstance(CounNum, str):
        if len(CounNum) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = CounNum
            requestString.append(None)
        else:
            requestString.append(','.join(CounNum))
    else:
        requestString.append(CounNum)
    requestString.append("&CounShortNameCN=")
    if hasattr(CounShortNameCN,'__iter__') and not isinstance(CounShortNameCN, str):
        if len(CounShortNameCN) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = CounShortNameCN
            requestString.append(None)
        else:
            requestString.append(','.join(CounShortNameCN))
    else:
        requestString.append(CounShortNameCN)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CountryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CountryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'CounCD2', u'CounCD3', u'CounNum', u'CounFullNameCN', u'CounShortNameCN', u'CounFullNameEN', u'CounShortNameEN']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'CounCD2': 'str','CounCD3': 'str','CounNum': 'str','CounFullNameCN': 'str','CounShortNameCN': 'str','CounFullNameEN': 'str','CounShortNameEN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PeopleGet(personID = "", name = "", field = "", pandas = "1"):
    """
    获取人物主表，姓名、学历、性别等。
    
    :param personID: 人员ID,可以是列表,personID、name至少选择一个
    :param name: 姓名,personID、name至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/master/getPeople.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PeopleGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PeopleGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'genderCD', u'gender', u'birthCD', u'eduCD', u'edu', u'backgroundDesc']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','genderCD': 'str','gender': 'str','birthCD': 'str','eduCD': 'str','edu': 'str','backgroundDesc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktEqudLatelyGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票个股最近一次日行情，当日数据更新返回当日数据，当日数据为更新之前返回上一个交易日数据，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码，如'000001'(可多值输入),可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqudLately.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktEqudLatelyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktEqudLatelyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preClosePrice', u'actPreClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'dealAmount', u'turnoverRate', u'accumAdjFactor', u'exDivDate', u'negMarketValue', u'marketValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktQuoteInfoGet(secID = "", ticker = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取沪深交易所可交易证券的行情报价基本要素，包含申报价格最小变动单位、申报数量下限、交易币种等。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktQuoteInfo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktQuoteInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktQuoteInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'quoteVolMin', u'quoteVolMinUnit', u'quotePriceMin', u'quotePriceMinUnit', u'transCurrCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','quoteVolMin': 'str','quoteVolMinUnit': 'str','quotePriceMin': 'str','quotePriceMinUnit': 'str','transCurrCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HSIIdMapGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHSIIdMap.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HSIIdMapGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HSIIdMapGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exCountryCD', u'ticker', u'secShortName', u'exchangeCD', u'secFullName', u'srcName', u'srcFullName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exCountryCD': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','secFullName': 'str','srcFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktIdxdLatelyGet(field = "", pandas = "1"):
    """
    获取指数基本信息及最新一个交易日的收盘行情。
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxdLately.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktIdxdLatelyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktIdxdLatelyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'publishDate', u'secShortName', u'indexTypeCD', u'indexType', u'pubOrgCD', u'porgFullName', u'baseDate', u'basePoint', u'endDate', u'isValid', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'CHG', u'CHGPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','indexTypeCD': 'str','indexType': 'str','porgFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktAdjfAf2006Get(secID = "", ticker = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取沪深股票用来调整历史行情的后复权因子数据（以2006-01-01价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及对应的生效日期区间。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在发生分红、配股、股改事件的除权除息日才有复权因子记录。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktAdjfAf2006.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktAdjfAf2006Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktAdjfAf2006Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'exDivDate', u'perCashDiv', u'perShareDivRatio', u'perShareTransRatio', u'allotmentRatio', u'allotmentPrice', u'adjFactor', u'accumAdjFactor', u'endDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktEqudAdjAf2006Get(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取获取沪深股票后复权收盘日行情（后复权基准起始日期为2006-01-01），包含后复权调整的昨收价、开盘价、最高价、最低价、收盘价等（含科创板）。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 输入股票代码，如000001。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部沪深股票复权行情数据，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqudAdjAf2006.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktEqudAdjAf2006Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktEqudAdjAf2006Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __IRATransLossGet(beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录沪市、深市及创业板的交易量及交易损耗（不包括B股）
    
    :param beginDate: 交易日，查询开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日，查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getIRATransLoss.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__IRATransLossGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__IRATransLossGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'shTurnoverValue', u'shTransLoss', u'szTurnoverValue', u'szTransLoss', u'cyTurnoverValue', u'cyTransLoss']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpMktRLStkNrGet(secID = "", ticker = "", beginDate = "", endDate = "", uniqID = "", abnormalTypeCD = "", field = "", pandas = "1"):
    """
    晚报-龙虎榜列表
    
    :param secID: 证券ID,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param beginDate: 根据交易日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据交易日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param uniqID: 龙虎榜单编码,可以是列表,可空
    :param abnormalTypeCD: 异动类型代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getRrpMktRLStkNr.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&uniqID=")
    if hasattr(uniqID,'__iter__') and not isinstance(uniqID, str):
        if len(uniqID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = uniqID
            requestString.append(None)
        else:
            requestString.append(','.join(uniqID))
    else:
        requestString.append(uniqID)
    requestString.append("&abnormalTypeCD=")
    if hasattr(abnormalTypeCD,'__iter__') and not isinstance(abnormalTypeCD, str):
        if len(abnormalTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = abnormalTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(abnormalTypeCD))
    else:
        requestString.append(abnormalTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpMktRLStkNrGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpMktRLStkNrGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'exchangeName', u'secShortName', u'tradeDate', u'abnormalDisplay', u'abnormalTypeCD', u'abnormalType', u'uniqID', u'deviation', u'turnoverVol', u'turnoverValue', u'abnormalBeginDate', u'abnormalEndDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','exchangeName': 'str','secShortName': 'str','abnormalDisplay': 'str','abnormalTypeCD': 'str','abnormalType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpMktRLStatNrGet(secID = "", ticker = "", beginDate = "", endDate = "", side = "", uniqID = "", abnormalTypeCD = "", field = "", pandas = "1"):
    """
    晚报-龙虎榜分类型统计
    
    :param secID: 证券ID,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param beginDate: 根据交易日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据交易日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param side: 买卖方向,可以是列表,可空
    :param uniqID: 龙虎榜单编码,可以是列表,可空
    :param abnormalTypeCD: 异动类型代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getRrpMktRLStatNr.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&side=")
    if hasattr(side,'__iter__') and not isinstance(side, str):
        if len(side) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = side
            requestString.append(None)
        else:
            requestString.append(','.join(side))
    else:
        requestString.append(side)
    requestString.append("&uniqID=")
    if hasattr(uniqID,'__iter__') and not isinstance(uniqID, str):
        if len(uniqID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = uniqID
            requestString.append(None)
        else:
            requestString.append(','.join(uniqID))
    else:
        requestString.append(uniqID)
    requestString.append("&abnormalTypeCD=")
    if hasattr(abnormalTypeCD,'__iter__') and not isinstance(abnormalTypeCD, str):
        if len(abnormalTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = abnormalTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(abnormalTypeCD))
    else:
        requestString.append(abnormalTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpMktRLStatNrGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpMktRLStatNrGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'exchangeName', u'secShortName', u'tradeDate', u'abnormalTypeCD', u'uniqID', u'side', u'rank', u'buyValue', u'sellValue', u'netValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','exchangeName': 'str','secShortName': 'str','abnormalTypeCD': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpMktRLSalesNrGet(secID = "", ticker = "", beginDate = "", endDate = "", side = "", uniqID = "", abnormalTypeCD = "", field = "", pandas = "1"):
    """
    晚报-龙虎榜成交明细
    
    :param secID: 证券ID,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param beginDate: 根据交易日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据交易日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param side: 买卖方向,可以是列表,可空
    :param uniqID: 龙虎榜单编码,可以是列表,可空
    :param abnormalTypeCD: 异动类型代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getRrpMktRLSalesNr.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&side=")
    if hasattr(side,'__iter__') and not isinstance(side, str):
        if len(side) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = side
            requestString.append(None)
        else:
            requestString.append(','.join(side))
    else:
        requestString.append(side)
    requestString.append("&uniqID=")
    if hasattr(uniqID,'__iter__') and not isinstance(uniqID, str):
        if len(uniqID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = uniqID
            requestString.append(None)
        else:
            requestString.append(','.join(uniqID))
    else:
        requestString.append(uniqID)
    requestString.append("&abnormalTypeCD=")
    if hasattr(abnormalTypeCD,'__iter__') and not isinstance(abnormalTypeCD, str):
        if len(abnormalTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = abnormalTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(abnormalTypeCD))
    else:
        requestString.append(abnormalTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpMktRLSalesNrGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpMktRLSalesNrGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'exchangeName', u'secShortName', u'tradeDate', u'abnormalTypeCD', u'abnormalType', u'uniqID', u'side', u'rank', u'sales', u'buyValue', u'sellValue', u'totalValue', u'netValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','exchangeName': 'str','secShortName': 'str','abnormalTypeCD': 'str','abnormalType': 'str','side': 'str','sales': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktAdjfAfKunhongGet(secID = "", ticker = "", exchangeCD = "", exDivDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票用来调整历史行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及对应的生效日期区间。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在发生分红、配股、股改事件的除权除息日才有复权因子记录。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param exDivDate: 除权除息日,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param beginDate: 除权除息日的起始查询日期,可空
    :param endDate: 除权除息日的截止查询日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktAdjfAfKunhong.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        exDivDate = exDivDate.strftime('%Y%m%d')
    except:
        exDivDate = exDivDate.replace('-', '')
    requestString.append("&exDivDate=%s"%(exDivDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktAdjfAfKunhongGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktAdjfAfKunhongGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'exDivDate', u'perCashDiv', u'perShareDivRatio', u'perShareTransRatio', u'allotmentRatio', u'allotmentPrice', u'splitsRatio', u'adjFactor', u'accumAdjFactor', u'endDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktAdjfAfKunhongV2Get(secID = "", ticker = "", exchangeCD = "", exDivDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票用来调整历史行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及对应的生效日期区间。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在发生分红、配股、股改事件的除权除息日才有复权因子记录。相比getMktAdjfAfKunhong，增加当日收盘前用前复权因子估算的后复权因子。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,可空
    :param exDivDate: 除权除息日,可空
    :param beginDate: 除权除息日的起始查询日期,可空
    :param endDate: 除权除息日的截止查询日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktAdjfAfKunhongV2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        exDivDate = exDivDate.strftime('%Y%m%d')
    except:
        exDivDate = exDivDate.replace('-', '')
    requestString.append("&exDivDate=%s"%(exDivDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktAdjfAfKunhongV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktAdjfAfKunhongV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'exDivDate', u'perCashDiv', u'perShareDivRatio', u'perShareTransRatio', u'allotmentRatio', u'allotmentPrice', u'splitsRatio', u'adjFactor', u'accumAdjFactor', u'endDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __StockTagsGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    根据股票因子数据，对股票进行分类，比如根据市值分为超级大盘股、大盘股、小盘股，根据PE分为高PE股，低PE股等。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 根据交易日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据交易日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getStockTags.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__StockTagsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__StockTagsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secID', u'tradeDate', u'marketValueStyle', u'growth', u'worth', u'price', u'leverage', u'pe', u'roe', u'mobility', u'profitability', u'momentum', u'volatility', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secID': 'str','marketValueStyle': 'str','growth': 'str','worth': 'str','price': 'str','leverage': 'str','pe': 'str','roe': 'str','mobility': 'str','profitability': 'str','momentum': 'str','volatility': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktEquLatestTraddayGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取某只股票在某一交易日的最近交易日，若当日不停牌，最近交易日即当日，若停牌，为上一个有成交的交易日（含科创板）。
    
    :param tradeDate: 交易日期
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquLatestTradday.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktEquLatestTraddayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktEquLatestTraddayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'exchangeCD', u'tradeDate', u'latestTradday']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __IdxReturnRateZAGet(secID = "", ticker = "", beginDate = "", endDate = "", returnRateType = "", field = "", pandas = "1"):
    """
    获取（定制）港股基金相关指数回报
    
    :param secID: 输入多个证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入多个基金代码，如"000001"。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param returnRateType: 输入一种或两种回报率类型，用","分隔，如"OTC"、"OTC,EXCH"。当RETURN_RATE_TYPE为OTC时为场外基金的回报率数据，以净值计算；当RETURN_RATE_TYPE为EXCH时为场内基金的回报率数据，以收盘价计算；不选默认为普通开放式基金场外交易的净值回报率。对应DataAPI.SysCodeGet.codeTypeID=40029。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getIdxReturnRateZA.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&returnRateType=")
    if hasattr(returnRateType,'__iter__') and not isinstance(returnRateType, str):
        if len(returnRateType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = returnRateType
            requestString.append(None)
        else:
            requestString.append(','.join(returnRateType))
    else:
        requestString.append(returnRateType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__IdxReturnRateZAGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__IdxReturnRateZAGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'assetClass', u'endDate', u'returnRateDaily', u'returnRateType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','assetClass': 'str','returnRateType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktIfFutPerfGet(tradeDate = "", uaTicker = "", uaShortName = "", field = "", pandas = "1"):
    """
    获取每日股指期货套利表现情况，包含标的收盘价、期指价格、期指涨跌幅、升贴水、套利收益率、年化套利收益率、 剩余天数等。
    
    :param tradeDate: 交易日期,tradeDate、uaTicker、uaShortName至少选择一个
    :param uaTicker: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,tradeDate、uaTicker、uaShortName至少选择一个
    :param uaShortName: 标的指数简称,tradeDate、uaTicker、uaShortName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIfFutPerf.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    if not isinstance(uaTicker, str) and not isinstance(uaTicker, unicode):
        uaTicker = str(uaTicker)

    requestString.append("&uaTicker=%s"%(uaTicker))
    if not isinstance(uaShortName, str) and not isinstance(uaShortName, unicode):
        uaShortName = str(uaShortName)

    requestString.append("&uaShortName=%s"%(uaShortName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktIfFutPerfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktIfFutPerfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'contractObject', u'tradeDate', u'closePrice', u'settlePrice', u'chgPct', u'uaTicker', u'uaShortName', u'uaClosePrice', u'uaChgPct', u'basis', u'returnRate', u'returnRateY', u'daysRemaining', u'mainCon']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','contractObject': 'str','uaTicker': 'str','uaShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktHKAdjfGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取港股用来调整历史行情的前复权因子数据，包含除权除息日、本次复权因子、累积复权因子以及对应的生效日期区间。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在除权除息日才有复权因子记录。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 除权除息日开始日期,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 除权除息日结束日期,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktHKAdjf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktHKAdjfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktHKAdjfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exDivDate', u'adjFactor', u'accumAdjFactor', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqudGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深股票未复权日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码，如'000001'(可多值输入),可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，只输入一个日期，可获取到一天全部沪深股票日行情数据,secID、ticker、tradeDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票今日是否开盘标记：0-未开盘，1-交易日,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqud.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqudGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqudGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preClosePrice', u'actPreClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'dealAmount', u'turnoverRate', u'accumAdjFactor', u'negMarketValue', u'marketValue', u'chgPct', u'PE', u'PE1', u'PB', u'isOpen', u'vwap']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutdGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取国内期货日行情信息，包含昨收盘、昨结算、开盘价、最高价、最低价、收盘价、结算价、成交量、成交金额、持仓量、主力合约标记、连续合约标记等。 其中主力合约按持仓量计算，完整的主力连续标记可从getMktFutPre获取。中金所结算价的更新时间为16:20，上期所无成交合约的结算价有可能在16:00左右有修正。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'tradeDate', u'contractObject', u'contractMark', u'preSettlePrice', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlePrice', u'turnoverVol', u'turnoverValue', u'openInt', u'CHG', u'CHG1', u'CHGPct', u'mainCon', u'smainCon']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','contractObject': 'str','contractMark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxdGet(indexID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取指数的日度收盘信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。沪深重要指数的更新时间为15:30，其他指数因发布机构不同会陆续更新。
    
    :param indexID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,indexID、ticker、tradeDate至少选择一个
    :param ticker: 指数通用代码,可以是列表,indexID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,indexID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxd.csv?ispandas=1&') 
    requestString.append("indexID=")
    if hasattr(indexID,'__iter__') and not isinstance(indexID, str):
        if len(indexID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indexID
            requestString.append(None)
        else:
            requestString.append(','.join(indexID))
    else:
        requestString.append(indexID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indexID', u'ticker', u'porgFullName', u'secShortName', u'exchangeCD', u'tradeDate', u'preCloseIndex', u'openIndex', u'lowestIndex', u'highestIndex', u'closeIndex', u'turnoverVol', u'turnoverValue', u'CHG', u'CHGPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indexID': 'str','ticker': 'str','porgFullName': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktBlockdGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", assetClass = "", field = "", pandas = "1"):
    """
    获取沪深股票、债券、基金的大宗交易信息，包含成交价、成交量、成交额、营业部等。交易所公布数据，更新时间可能会有延迟。
    
    :param secID: 通联编制的证券编码， 可通过DataAPI.SecIDGet获取。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 起始查询日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止查询日期，输入格式“YYYYMMDD”,可空
    :param assetClass: 通联编制的证券类型编码,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktBlockd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktBlockdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktBlockdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'secID', u'ticker', u'assetClass', u'exchangeCD', u'secFullName', u'currencyCD', u'tradePrice', u'tradeVal', u'tradeVol', u'buyerBD', u'sellerBD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','assetClass': 'str','exchangeCD': 'str','secFullName': 'str','currencyCD': 'str','buyerBD': 'str','sellerBD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktRepodGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取债券回购交易日行情信息，包含开盘利率、最高利率、最低利率、收盘利率、成交量、成交金额、成交笔数等。沪深交易所15:50更新，银行间市场21:00更新。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktRepod.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktRepodGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktRepodGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preCloseRate', u'openRate', u'highestRate', u'lowestRate', u'closeRate', u'turnoverVol', u'turnoverValue', u'dealAmount']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktBonddGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深债券日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等。除深交所可转换公司债券及可交换公司债券为全价交易，其余品种为净价交易。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktBondd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktBonddGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktBonddGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'dealAmount', u'accrInterest', u'YTM', u'VWAP', u'grossClosePrice']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktHKEqudGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取港交所股票未复权日行情信息，包含昨收盘价、开盘价、最高价、最低价、收盘价、成交量、成交金额等。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktHKEqud.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktHKEqudGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktHKEqudGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'tradeDate', u'preClosePrice', u'actPreClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'SMA10', u'SMA20', u'SMA50', u'SMA250', u'chg', u'chgPct', u'marketValue', u'negMarketValue', u'PE', u'PE1', u'PB', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktStockFactorsOneDayGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取多只股票历史上某一天的因子数据
    
    :param tradeDate: 日期
    :param secID: 多只股票ID，用逗号隔开,可以是列表,可空
    :param ticker: 多只股票交易代码，用逗号隔开,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getStockFactorsOneDay.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktStockFactorsOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktStockFactorsOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'AccountsPayablesTDays', u'AccountsPayablesTRate', u'AdminiExpenseRate', u'ARTDays', u'ARTRate', u'ASSI', u'BLEV', u'BondsPayableToAsset', u'CashRateOfSales', u'CashToCurrentLiability', u'CMRA', u'CTOP', u'CTP5', u'CurrentAssetsRatio', u'CurrentAssetsTRate', u'CurrentRatio', u'DAVOL10', u'DAVOL20', u'DAVOL5', u'DDNBT', u'DDNCR', u'DDNSR', u'DebtEquityRatio', u'DebtsAssetRatio', u'DHILO', u'DilutedEPS', u'DVRAT', u'EBITToTOR', u'EGRO', u'EMA10', u'EMA120', u'EMA20', u'EMA5', u'EMA60', u'EPS', u'EquityFixedAssetRatio', u'EquityToAsset', u'EquityTRate', u'ETOP', u'ETP5', u'FinancialExpenseRate', u'FinancingCashGrowRate', u'FixAssetRatio', u'FixedAssetsTRate', u'GrossIncomeRatio', u'HBETA', u'HSIGMA', u'IntangibleAssetRatio', u'InventoryTDays', u'InventoryTRate', u'InvestCashGrowRate', u'LCAP', u'LFLO', u'LongDebtToAsset', u'LongDebtToWorkingCapital', u'LongTermDebtToAsset', u'MA10', u'MA120', u'MA20', u'MA5', u'MA60', u'MAWVAD', u'MFI', u'MLEV', u'NetAssetGrowRate', u'NetProfitGrowRate', u'NetProfitRatio', u'NOCFToOperatingNI', u'NonCurrentAssetsRatio', u'NPParentCompanyGrowRate', u'NPToTOR', u'OperatingExpenseRate', u'OperatingProfitGrowRate', u'OperatingProfitRatio', u'OperatingProfitToTOR', u'OperatingRevenueGrowRate', u'OperCashGrowRate', u'OperCashInToCurrentLiability', u'PB', u'PCF', u'PE', u'PS', u'PSY', u'QuickRatio', u'REVS10', u'REVS20', u'REVS5', u'ROA', u'ROA5', u'ROE', u'ROE5', u'RSI', u'RSTR12', u'RSTR24', u'SalesCostRatio', u'SaleServiceCashToOR', u'SUE', u'TaxRatio', u'TOBT', u'TotalAssetGrowRate', u'TotalAssetsTRate', u'TotalProfitCostRatio', u'TotalProfitGrowRate', u'VOL10', u'VOL120', u'VOL20', u'VOL240', u'VOL5', u'VOL60', u'WVAD', u'REC', u'DAREC', u'GREC', u'FY12P', u'DAREV', u'GREV', u'SFY12P', u'DASREV', u'GSREV', u'FEARNG', u'FSALESG', u'TA2EV', u'CFO2EV', u'ACCA', u'DEGM', u'SUOI', u'EARNMOM', u'FiftyTwoWeekHigh', u'Volatility', u'Skewness', u'ILLIQUIDITY', u'BackwardADJ', u'MACD', u'ADTM', u'ATR14', u'ATR6', u'BIAS10', u'BIAS20', u'BIAS5', u'BIAS60', u'BollDown', u'BollUp', u'CCI10', u'CCI20', u'CCI5', u'CCI88', u'KDJ_K', u'KDJ_D', u'KDJ_J', u'ROC6', u'ROC20', u'SBM', u'STM', u'UpRVI', u'DownRVI', u'RVI', u'SRMI', u'ChandeSD', u'ChandeSU', u'CMO', u'DBCD', u'ARC', u'OBV', u'OBV6', u'OBV20', u'TVMA20', u'TVMA6', u'TVSTD20', u'TVSTD6', u'VDEA', u'VDIFF', u'VEMA10', u'VEMA12', u'VEMA26', u'VEMA5', u'VMACD', u'VOSC', u'VR', u'VROC12', u'VROC6', u'VSTD10', u'VSTD20', u'KlingerOscillator', u'MoneyFlow20', u'AD', u'AD20', u'AD6', u'CoppockCurve', u'ASI', u'ChaikinOscillator', u'ChaikinVolatility', u'EMV14', u'EMV6', u'plusDI', u'minusDI', u'ADX', u'ADXR', u'Aroon', u'AroonDown', u'AroonUp', u'DEA', u'DIFF', u'DDI', u'DIZ', u'DIF', u'MTM', u'MTMMA', u'PVT', u'PVT6', u'PVT12', u'TRIX5', u'TRIX10', u'UOS', u'MA10RegressCoeff12', u'MA10RegressCoeff6', u'PLRC6', u'PLRC12', u'SwingIndex', u'Ulcer10', u'Ulcer5', u'Hurst', u'ACD6', u'ACD20', u'EMA12', u'EMA26', u'APBMA', u'BBI', u'BBIC', u'TEMA10', u'TEMA5', u'MA10Close', u'AR', u'BR', u'ARBR', u'CR20', u'MassIndex', u'BearPower', u'BullPower', u'Elder', u'NVI', u'PVI', u'RC12', u'RC24', u'JDQS20']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktStockFactorsDateRangeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取一只股票历史上某一时间段的因子数据
    
    :param secID: 一只股票ID,secID、ticker至少选择一个
    :param ticker: 一只股票交易代码,secID、ticker至少选择一个
    :param beginDate: 开始日期,可空
    :param endDate: 结束日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getStockFactorsDateRange.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktStockFactorsDateRangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktStockFactorsDateRangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'AccountsPayablesTDays', u'AccountsPayablesTRate', u'AdminiExpenseRate', u'ARTDays', u'ARTRate', u'ASSI', u'BLEV', u'BondsPayableToAsset', u'CashRateOfSales', u'CashToCurrentLiability', u'CMRA', u'CTOP', u'CTP5', u'CurrentAssetsRatio', u'CurrentAssetsTRate', u'CurrentRatio', u'DAVOL10', u'DAVOL20', u'DAVOL5', u'DDNBT', u'DDNCR', u'DDNSR', u'DebtEquityRatio', u'DebtsAssetRatio', u'DHILO', u'DilutedEPS', u'DVRAT', u'EBITToTOR', u'EGRO', u'EMA10', u'EMA120', u'EMA20', u'EMA5', u'EMA60', u'EPS', u'EquityFixedAssetRatio', u'EquityToAsset', u'EquityTRate', u'ETOP', u'ETP5', u'FinancialExpenseRate', u'FinancingCashGrowRate', u'FixAssetRatio', u'FixedAssetsTRate', u'GrossIncomeRatio', u'HBETA', u'HSIGMA', u'IntangibleAssetRatio', u'InventoryTDays', u'InventoryTRate', u'InvestCashGrowRate', u'LCAP', u'LFLO', u'LongDebtToAsset', u'LongDebtToWorkingCapital', u'LongTermDebtToAsset', u'MA10', u'MA120', u'MA20', u'MA5', u'MA60', u'MAWVAD', u'MFI', u'MLEV', u'NetAssetGrowRate', u'NetProfitGrowRate', u'NetProfitRatio', u'NOCFToOperatingNI', u'NonCurrentAssetsRatio', u'NPParentCompanyGrowRate', u'NPToTOR', u'OperatingExpenseRate', u'OperatingProfitGrowRate', u'OperatingProfitRatio', u'OperatingProfitToTOR', u'OperatingRevenueGrowRate', u'OperCashGrowRate', u'OperCashInToCurrentLiability', u'PB', u'PCF', u'PE', u'PS', u'PSY', u'QuickRatio', u'REVS10', u'REVS20', u'REVS5', u'ROA', u'ROA5', u'ROE', u'ROE5', u'RSI', u'RSTR12', u'RSTR24', u'SalesCostRatio', u'SaleServiceCashToOR', u'SUE', u'TaxRatio', u'TOBT', u'TotalAssetGrowRate', u'TotalAssetsTRate', u'TotalProfitCostRatio', u'TotalProfitGrowRate', u'VOL10', u'VOL120', u'VOL20', u'VOL240', u'VOL5', u'VOL60', u'WVAD', u'REC', u'DAREC', u'GREC', u'FY12P', u'DAREV', u'GREV', u'SFY12P', u'DASREV', u'GSREV', u'FEARNG', u'FSALESG', u'TA2EV', u'CFO2EV', u'ACCA', u'DEGM', u'SUOI', u'EARNMOM', u'FiftyTwoWeekHigh', u'Volatility', u'Skewness', u'ILLIQUIDITY', u'BackwardADJ', u'MACD', u'ADTM', u'ATR14', u'ATR6', u'BIAS10', u'BIAS20', u'BIAS5', u'BIAS60', u'BollDown', u'BollUp', u'CCI10', u'CCI20', u'CCI5', u'CCI88', u'KDJ_K', u'KDJ_D', u'KDJ_J', u'ROC6', u'ROC20', u'SBM', u'STM', u'UpRVI', u'DownRVI', u'RVI', u'SRMI', u'ChandeSD', u'ChandeSU', u'CMO', u'DBCD', u'ARC', u'OBV', u'OBV6', u'OBV20', u'TVMA20', u'TVMA6', u'TVSTD20', u'TVSTD6', u'VDEA', u'VDIFF', u'VEMA10', u'VEMA12', u'VEMA26', u'VEMA5', u'VMACD', u'VOSC', u'VR', u'VROC12', u'VROC6', u'VSTD10', u'VSTD20', u'KlingerOscillator', u'MoneyFlow20', u'AD', u'AD20', u'AD6', u'CoppockCurve', u'ASI', u'ChaikinOscillator', u'ChaikinVolatility', u'EMV14', u'EMV6', u'plusDI', u'minusDI', u'ADX', u'ADXR', u'Aroon', u'AroonDown', u'AroonUp', u'DEA', u'DIFF', u'DDI', u'DIZ', u'DIF', u'MTM', u'MTMMA', u'PVT', u'PVT6', u'PVT12', u'TRIX5', u'TRIX10', u'UOS', u'MA10RegressCoeff12', u'MA10RegressCoeff6', u'PLRC6', u'PLRC12', u'SwingIndex', u'Ulcer10', u'Ulcer5', u'Hurst', u'ACD6', u'ACD20', u'EMA12', u'EMA26', u'APBMA', u'BBI', u'BBIC', u'TEMA10', u'TEMA5', u'MA10Close', u'AR', u'BR', u'ARBR', u'CR20', u'MassIndex', u'BearPower', u'BullPower', u'Elder', u'NVI', u'PVI', u'RC12', u'RC24', u'JDQS20']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFunddGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深基金未复权日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFundd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFunddGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFunddGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'CHG', u'CHGPct', u'turnoverVol', u'turnoverValue', u'discount', u'discountRatio', u'circulationShares', u'accumAdjFactor']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutMTRGet(beginDate = "", endDate = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取每日期货会员成交量排名信息，包含合约代码、期货会员简称、成交量、成交量增减、当日排名等。交易所只公布当日总持仓量达到一定标准的合约，详见交易所相关规则。因各交易所发布时间有差异，更新可能会有延迟。
    
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询tradeDate截止日期，输入格式“YYYYMMDD”,可空
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutMTR.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutMTRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutMTRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'partyShortName', u'exchangeCD', u'tradeDate', u'turnoverVol', u'CHG', u'rank']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','partyShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutMSRGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取每日期货会员持卖仓排名信息，包含合约代码、期货会员简称、持卖仓量、持卖仓量增减、当日排名等。交易所只公布当日总持仓量达到一定标准的合约，详见交易所相关规则。因各交易所发布时间有差异，更新可能会有延迟。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询tradeDate截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutMSR.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutMSRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutMSRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'partyShortName', u'exchangeCD', u'tradeDate', u'shortVol', u'CHG', u'rank']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','partyShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutMLRGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取每日期货会员持买仓排名信息，包含合约代码、期货会员简称、持买仓量、持买仓量增减、当日排名等。交易所只公布当日总持仓量达到一定标准的合约，详见交易所相关规则。因各交易所发布时间有差异，更新可能会有延迟。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询tradeDate截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutMLR.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutMLRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutMLRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'partyShortName', u'exchangeCD', u'tradeDate', u'longVol', u'CHG', u'rank']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','partyShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutWRdGet(beginDate, endDate, contractObject = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取商品期货每日仓单库存信息，包括品种代码、交易市场、仓库名称、上期仓单量、本期仓单量等。因不同交易所发布时间不同，更新时间会有差异。
    
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询tradeDate截止日期，输入格式“YYYYMMDD”
    :param contractObject: 品种代码,可以是列表,可空
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutWRd.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&contractObject=")
    if hasattr(contractObject,'__iter__') and not isinstance(contractObject, str):
        if len(contractObject) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractObject
            requestString.append(None)
        else:
            requestString.append(','.join(contractObject))
    else:
        requestString.append(contractObject)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutWRdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutWRdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'contractObject', u'exchangeCD', u'unit', u'warehouse', u'preWrVOL', u'wrVOL', u'chg']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'contractObject': 'str','exchangeCD': 'str','unit': 'str','warehouse': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktMFutdGet(mainCon = "", contractMark = "", contractObject = "", tradeDate = "", startDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取国内期货日行情信息（底层数据与期货日行情一致，区别是此接口可从主力连续合约角度获取连续行情），包含昨收盘、昨结算、开盘价、最高价、最低价、收盘价、结算价、成交量、成交金额、持仓量、主力合约标记、连续合约标记等。 其中主力合约按持仓量计算，完整的主力连续标记可从getMktFutPre获取。中金所结算价的更新时间为16:20，上期所无成交合约的结算价有可能在16:00左右修正。
    
    :param mainCon: 是否主力（持仓量），1-是；0-否,mainCon、contractMark、contractObject、tradeDate至少选择一个
    :param contractMark: 连续合约标志,mainCon、contractMark、contractObject、tradeDate至少选择一个
    :param contractObject: 期货合约标的代码,mainCon、contractMark、contractObject、tradeDate至少选择一个
    :param tradeDate: 交易日期,mainCon、contractMark、contractObject、tradeDate至少选择一个
    :param startDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktMFutd.csv?ispandas=1&') 
    if not isinstance(mainCon, str) and not isinstance(mainCon, unicode):
        mainCon = str(mainCon)

    requestString.append("mainCon=%s"%(mainCon))
    if not isinstance(contractMark, str) and not isinstance(contractMark, unicode):
        contractMark = str(contractMark)

    requestString.append("&contractMark=%s"%(contractMark))
    if not isinstance(contractObject, str) and not isinstance(contractObject, unicode):
        contractObject = str(contractObject)

    requestString.append("&contractObject=%s"%(contractObject))
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        startDate = startDate.strftime('%Y%m%d')
    except:
        startDate = startDate.replace('-', '')
    requestString.append("&startDate=%s"%(startDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktMFutdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktMFutdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEN', u'tradeDate', u'contractObject', u'contractMark', u'preSettlePrice', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'settlePrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'openInt', u'chg', u'chg1', u'chgPct', u'mainCon', u'smainCon']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEN': 'str','contractObject': 'str','contractMark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktOptdGet(secID = "", optID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取国内期权日行情信息，主要为商品期权及50ETF期权，包含昨结算、昨收盘、开盘价、最高价、最低价、收盘价、结算价、成交量、成交金额、持仓量等。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,secID、optID、ticker、tradeDate至少选择一个
    :param optID: 上交所指定的8位期权编码，商品期权无此字段,secID、optID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,secID、optID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、optID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param exchangeCD: 通联编制的交易市场编码,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktOptd.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(optID, str) and not isinstance(optID, unicode):
        optID = str(optID)

    requestString.append("&optID=%s"%(optID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktOptdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktOptdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'optID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preSettlePrice', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlPrice', u'turnoverVol', u'turnoverValue', u'openInt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','optID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktOptExerGet(exerDate, secID = "", ticker = "", contractType = "", field = "", pandas = "1"):
    """
    获取上交所50ETF期权标的行权交收信息，50期权为欧式期权，行权交收日固定为到期月份的第四个星期三，每月更新。
    
    :param exerDate: 行权日期，合约到期月份的第四个星期三（遇法定节假日顺延）
    :param secID: 期权标的对应的通联编制的证券编码，可使用DataAPI.SecIDGet获取。目前只有50ETF一种标的，secID为"510050.XSHG",可以是列表,secID、ticker至少选择一个
    :param ticker: 期权标的对应的通联编制的交易市场编码,可以是列表,secID、ticker至少选择一个
    :param contractType: 期权合约类型，CO-认购期权，PO-认沽期权。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktOptExer.csv?ispandas=1&') 
    try:
        exerDate = exerDate.strftime('%Y%m%d')
    except:
        exerDate = exerDate.replace('-', '')
    requestString.append("exerDate=%s"%(exerDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(contractType, str) and not isinstance(contractType, unicode):
        contractType = str(contractType)

    requestString.append("&contractType=%s"%(contractType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktOptExerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktOptExerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exerDate', u'contractType', u'exerVol']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','contractType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqudAdjGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深股票前复权收盘日行情，包含前复权调整后的昨收价、开盘价、最高价、最低价、收盘价等。于除权除息日对历史行情的调整，更新时间为9:00前（含科创板）。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码，如'000001'（可多值输入）,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 结束日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票今日是否开盘标记：0-未开盘，1-交易日,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqudAdj.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqudAdjGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqudAdjGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preClosePrice', u'actPreClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'negMarketValue', u'dealAmount', u'turnoverRate', u'accumAdjFactor', u'turnoverValue', u'marketValue', u'isOpen']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktAdjfGet(secID = "", ticker = "", exDivDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票用来调整历史行情的前复权因子数据，包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及对应的生效日期区间。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在发生分红、配股、股改事件的除权除息日才有复权因子记录。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、exDivDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、exDivDate至少选择一个
    :param exDivDate: 除权除息日，股改对应股改后首个交易日，输入格式：YYYYMMDD,secID、ticker、exDivDate至少选择一个
    :param beginDate: 除权除息日的起始查询日期,可空
    :param endDate: 除权除息日的截止查询日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktAdjf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        exDivDate = exDivDate.strftime('%Y%m%d')
    except:
        exDivDate = exDivDate.replace('-', '')
    requestString.append("&exDivDate=%s"%(exDivDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktAdjfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktAdjfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'exDivDate', u'perCashDiv', u'perShareDivRatio', u'perShareTransRatio', u'allotmentRatio', u'allotmentPrice', u'adjFactor', u'accumAdjFactor', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutdVolGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取国内期货日行情信息，包含昨收盘、昨结算、开盘价、最高价、最低价、收盘价、结算价、成交量、成交金额、持仓量、主力合约标记、连续合约标记等。 其中主力合约按成交量计算，完整的主力连续标记可从getMktFutPre获取。中金所结算价的更新时间为16:20，上期所无成交合约的结算价有可能在16:00左右有修正。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutdVol.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutdVolGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutdVolGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'tradeDate', u'contractObject', u'contractMark', u'preSettlePrice', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlePrice', u'turnoverVol', u'turnoverValue', u'openInt', u'CHG', u'CHG1', u'CHGPct', u'mainCon', u'smainCon']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','contractObject': 'str','contractMark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktLimitGet(secID = "", ticker = "", tradeDate = "", exchangeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深交易所股票及基金的涨跌停限制信息，包含涨停价、跌停价、达到涨停次数、达到跌停次数（含科创板）。
    
    :param secID: 通联编制的证券编码， 可通过DataAPI.SecIDGet获取。,可以是列表,secID、ticker、tradeDate、exchangeCD至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate、exchangeCD至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码,可以是列表,secID、ticker、tradeDate、exchangeCD至少选择一个
    :param beginDate: 起始查询日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止查询日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktLimit.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktLimitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktLimitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'secShortNameEn', u'exchangeCD', u'tradeDate', u'limitUpPrice', u'limitDownPrice', u'upLimitReachedTimes', u'downLimitReachedTimes']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','secShortNameEn': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecTipsGet(tipsTypeCD = "", tipsType = "", field = "", pandas = "1"):
    """
    上海证券交易所、深圳证券交易所今日停复牌股票列表。数据更新频率：日。
    
    :param tipsTypeCD: 交易提示类型。H-停牌，R-复牌,可空
    :param tipsType: 交易提示类型中文，可输入中文：“停牌”；“复牌”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSecTips.csv?ispandas=1&') 
    if not isinstance(tipsTypeCD, str) and not isinstance(tipsTypeCD, unicode):
        tipsTypeCD = str(tipsTypeCD)

    requestString.append("tipsTypeCD=%s"%(tipsTypeCD))
    if not isinstance(tipsType, str) and not isinstance(tipsType, unicode):
        tipsType = str(tipsType)

    requestString.append("&tipsType=%s"%(tipsType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecTipsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecTipsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'tipsDesc', u'tipsTypeCD', u'tipsType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','tipsDesc': 'str','tipsTypeCD': 'str','tipsType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFunddAdjGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深基金后复权日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFunddAdj.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFunddAdjGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFunddAdjGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'secShortNameEn', u'ticker', u'exchangeCD', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','secShortNameEn': 'str','ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFunddAdjBfGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深基金前复权日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFunddAdjBf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFunddAdjBfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFunddAdjBfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'secShortNameEn', u'exchangeCD', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','secShortNameEn': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquFlowGet(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票日度资金流向数据，包含资金流入、资金流出、资金净流入、开盘净流入、尾盘净流入等（含科创板）。
    
    :param tradeDate: 交易日期,tradeDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,tradeDate、secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquFlow.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquFlowGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquFlowGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'secShortNameEn', u'exchangeCD', u'tradeDate', u'moneyInflow', u'moneyOutflow', u'netMoneyInflow', u'netInflowRate', u'netInflowOpen', u'netInflowClose', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','secShortNameEn': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIndustryFlowGet(tradeDate = "", industryID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票每日行业资金流向数据，包含行业资金流入、资金流出、资金净流入、开盘净流入、尾盘净流入等。行业分类标准包含申万一二三级行业及证监会二级行业。
    
    :param tradeDate: 交易日期,tradeDate、industryID至少选择一个
    :param industryID: 通联编制的行业分类编码，可以通过getIndustry获取。证监会二级行业：industryVersionCD=010301，industryLevel=2；申万一二三级行业分类：industryVersionCD=010303,可以是列表,tradeDate、industryID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIndustryFlow.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIndustryFlowGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIndustryFlowGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'industryID', u'industryName', u'tradeDate', u'moneyInflow', u'moneyOutflow', u'netMoneyInflow', u'netInflowRate', u'netInflowOpen', u'netInflowClose', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industryID': 'str','industryName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktAdjfAfGet(secID = "", ticker = "", exchangeCD = "", exDivDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票用来调整历史行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及对应的生效日期区间。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在发生分红、配股、股改事件的除权除息日才有复权因子记录。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param exDivDate: 除权除息日,secID、ticker、exchangeCD、exDivDate至少选择一个
    :param beginDate: 除权除息日的起始查询日期,可空
    :param endDate: 除权除息日的截止查询日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktAdjfAf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        exDivDate = exDivDate.strftime('%Y%m%d')
    except:
        exDivDate = exDivDate.replace('-', '')
    requestString.append("&exDivDate=%s"%(exDivDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktAdjfAfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktAdjfAfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'exDivDate', u'perCashDiv', u'perShareDivRatio', u'perShareTransRatio', u'allotmentRatio', u'allotmentPrice', u'splitsRatio', u'adjFactor', u'accumAdjFactor', u'endDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqudAdjAfGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取获取沪深股票后复权收盘日行情，包含后复权调整的昨收价、开盘价、最高价、最低价、收盘价等（含科创板）。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 结束日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票今日是否开盘标记：0-未开盘，1-交易日,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqudAdjAf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqudAdjAfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqudAdjAfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preClosePrice', u'actPreClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'dealAmount', u'turnoverRate', u'accumAdjFactor', u'negMarketValue', u'marketValue', u'isOpen']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquFlowOrderGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票日度资金流向的单类大小明细数据，包含小/中/大/超大四种单类的流入、流出、净流入等（含科创板）。其中单类大小定义为：（单位：元）无-N：0小-S:(0，100万]中-M:(100万，500万]大-L:(500万，1000万]超大-XL:1000万以上
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式为yyyymmdd,可空
    :param endDate: 截止日期，输入格式为yyyymmdd,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquFlowOrder.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquFlowOrderGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquFlowOrderGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeDate', u'inflowS', u'inflowM', u'inflowL', u'inflowXl', u'outflowS', u'outflowM', u'outflowL', u'outflowXl', u'netInflowS', u'netInflowM', u'netInflowL', u'netInflowXl', u'netRateS', u'netRateM', u'netRateL', u'netRateXL', u'mainInflow', u'mainRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIndustryFlowOrderGet(tradeDate = "", beginDate = "", endDate = "", industryID = "", field = "", pandas = "1"):
    """
    获取沪深股票每日行业资金流向数据，包含小、中、大、超大单及主力的资金流入、资金流出、资金净流入等。行业分类标准包含申万一二三级行业及证监会二级行业。其中单类大小定义为：（单位：元）N：0S:(0，100万]M:(100万，500万]L:(500万，1000万]XL:1000万以上
    
    :param tradeDate: 交易日期,可空
    :param beginDate: 起始日期，输入格式为yyyymmdd,可空
    :param endDate: 截止日期，输入格式为yyyymmdd,可空
    :param industryID: 通联编制的行业分类编码，可以通过getIndustry获取。证监会二级行业：industryVersionCD=010301，industryLevel=2；申万一二三级行业分类：industryVersionCD=010303,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIndustryFlowOrder.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIndustryFlowOrderGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIndustryFlowOrderGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'industryID', u'industryName', u'tradeDate', u'inflowS', u'inflowM', u'inflowL', u'inflowXl', u'outflowS', u'outflowM', u'outflowL', u'outflowXl', u'netInflowS', u'netInflowM', u'netInflowL', u'netInflowXl', u'netRateS', u'netRateM', u'netRateL', u'netRateXL', u'mainInflow', u'mainRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industryID': 'str','industryName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def InvestorsStatsGet(beginDate, endDate, statCycle = "", field = "", pandas = "1"):
    """
    记录周期内，如一周内新增投资者数量、期末投资者数量、期末持仓投资者数量、期间参与交易的投资者数量的统计数据。周频数据已与2019年2月停止发布，最后一期为20190222。
    
    :param beginDate: 统计周期起始日期为基准，查询起始日，输入格式“YYYYMMDD”
    :param endDate: 统计周期起始日期为基准，查询截止日，输入格式“YYYYMMDD”
    :param statCycle: 统计周期，W-每周,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getInvestorsStats.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(statCycle, str) and not isinstance(statCycle, unicode):
        statCycle = str(statCycle)

    requestString.append("&statCycle=%s"%(statCycle))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'InvestorsStatsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'InvestorsStatsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'statsBeginDate', u'statsEnddate', u'newlyIncreased', u'newlyIncreasedNatural', u'newlyIncreasedNonnatural', u'endingNumber', u'endingNatural', u'endingNaturalA', u'endingNaturalB', u'endingNonnatural', u'endingNonnaturalA', u'endingNonnaturalB', u'endingHolding', u'endingHoldingA', u'endingHoldingB', u'endingTrading', u'endingTradingA', u'endingTradingB', u'statCycle']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'statCycle': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktSpotdGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取现货日度收盘行情，包含开盘价、最高价、最低价、收盘价、成交量、持仓量、成交金额等。目前覆盖上海黄金交易所。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码，输入符号需使用%ASCII码，如Au(T+D)对应Au(T%2bD),可以是列表,secID、ticker至少选择一个
    :param tradeDate: 交易日期,可空
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktSpotd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktSpotdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktSpotdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'chg', u'chgPct', u'wPrice', u'turnoverVolume', u'turnoverValue', u'openInt', u'deliverySide', u'deliveryVol']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def InvestorCapitalChgGet(beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    证券及股票期权投资者的资金余额及变动情况
    
    :param beginDate: 统计起始日期为基准，查询起始日，输入格式“YYYYMMDD”,可空
    :param endDate: 统计起始日期为基准，查询截止日，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getInvestorCapitalChg.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'InvestorCapitalChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'InvestorCapitalChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'statsBeginDate', u'statsEnddate', u'capitalType', u'endingBalance', u'dailyAverage', u'transIn', u'transOut', u'netTransIn', u'remark']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFxRefRateGet(currencyPair, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取外汇交易中心发布的人民币汇率中间价，包含货币对，中间价等。
    
    :param currencyPair: 货币对，例如100JPY/CNY、AUD/CNY、CAD/CNY、CNY/MYR、CNY/RUB、EUR/CNY、GBP/CNY、HKD/CNY、NZD/CNY、USD/CNY
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFxRefRate.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFxRefRateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFxRefRateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'currencyPair', u'midRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktOptStatsGet(tradeDate = "", secID = "", ticker = "", beginDate = "", endDate = "", statsInterval = "", field = "", pandas = "1"):
    """
    获取上交所50ETF期权日度及月度交易统计信息，包含总成交量、认购成交量、认沽成交量、认沽认购比、未平仓合约总数、未平仓认购合约数、未平仓认沽合约数等。
    
    :param tradeDate: 交易日期,tradeDate、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,tradeDate、secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,tradeDate、secID、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param statsInterval: 数据统计区间，2-月；4-日,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktOptStats.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&statsInterval=")
    if hasattr(statsInterval,'__iter__') and not isinstance(statsInterval, str):
        if len(statsInterval) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsInterval
            requestString.append(None)
        else:
            requestString.append(','.join(statsInterval))
    else:
        requestString.append(statsInterval)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktOptStatsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktOptStatsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'statsInterval', u'tradeDate', u'turnoverVol', u'cVol', u'pVol', u'pcRate', u'openInt', u'cOpenInt', u'pOpenInt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktOptTdRankGet(ticker = "", secID = "", tradeDate = "", beginDate = "", endDate = "", statsType = "", rank = "", field = "", pandas = "1"):
    """
    获取上交所50ETF期权每日最活跃合约的成交及持仓排名信息，包含统计类型、经营机构名称、排名、标的代码、成交量或持仓量等。统计范围为持仓量排名前三、成交量排名前三的认沽、认购合约，总计四种统计类型。
    
    :param ticker: 期权标的对应的通用交易代码,ticker、secID、tradeDate至少选择一个
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,ticker、secID、tradeDate至少选择一个
    :param tradeDate: 交易日期,ticker、secID、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param statsType: 统计项目类型，0101-成交最大3个合约的认购交易情况;0102-成交最大3个合约的认沽交易情况;0201-持仓最大3个合约的认购交易情况;0202-持仓最大3个合约的认沽交易情况,可空
    :param rank: 排名，根据统计类型排的名次,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktOptTdRank.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(statsType, str) and not isinstance(statsType, unicode):
        statsType = str(statsType)

    requestString.append("&statsType=%s"%(statsType))
    if not isinstance(rank, str) and not isinstance(rank, unicode):
        rank = str(rank)

    requestString.append("&rank=%s"%(rank))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktOptTdRankGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktOptTdRankGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'rank', u'volume', u'partyID', u'partyShortName', u'statsType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','partyShortName': 'str','statsType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquwGet(secID = "", ticker = "", weekEndDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深股票未复权周行情，在未复权日行情基础上计算，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param weekEndDate: 当周最后一个交易日，输入格式“YYYYMMDD”,secID、ticker、weekEndDate至少选择一个
    :param beginDate: 查询weekEndDate的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询weekEndDate的截止日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票当周是否开盘标记位：0-未开盘，1-有交易。 当周交易天数为0时属于未开盘。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquw.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        weekEndDate = weekEndDate.strftime('%Y%m%d')
    except:
        weekEndDate = weekEndDate.replace('-', '')
    requestString.append("&weekEndDate=%s"%(weekEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquwGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquwGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'weekBeginDate', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'return', u'turnoverRate', u'avgTurnoverRate', u'varReturn100', u'sdReturn100', u'avgReturn100']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquwAdjGet(secID = "", ticker = "", weekEndDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深股票前复权周行情，在前复权日行情基础上计算，包含经前复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。于除权除息日对历史行情的调整，更新时间为9:00前（含科创板）。
    
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param weekEndDate: 当周最后一个交易日，输入格式“YYYYMMDD”,secID、ticker、weekEndDate至少选择一个
    :param beginDate: 查询weekEndDate的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询weekEndDate的截止日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票当周是否开盘标记位：0-未开盘，1-有交易。 当周交易天数为0时属于未开盘。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquwAdj.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        weekEndDate = weekEndDate.strftime('%Y%m%d')
    except:
        weekEndDate = weekEndDate.replace('-', '')
    requestString.append("&weekEndDate=%s"%(weekEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquwAdjGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquwAdjGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'weekBeginDate', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'return', u'turnoverRate', u'avgTurnoverRate', u'varReturn100', u'sdReturn100', u'avgReturn100']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquwAdjAfGet(secID = "", ticker = "", weekEndDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深股票后复权周行情，在后复权日行情基础上计算，包含经后复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、weekEndDate至少选择一个
    :param weekEndDate: 当周最后一个交易日，输入格式“YYYYMMDD”,secID、ticker、weekEndDate至少选择一个
    :param beginDate: 查询weekEndDate的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询weekEndDate的截止日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票当周是否开盘标记位：0-未开盘，1-有交易。 当周交易天数为0时属于未开盘。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquwAdjAf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        weekEndDate = weekEndDate.strftime('%Y%m%d')
    except:
        weekEndDate = weekEndDate.replace('-', '')
    requestString.append("&weekEndDate=%s"%(weekEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquwAdjAfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquwAdjAfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'weekBeginDate', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'return', u'turnoverRate', u'avgTurnoverRate', u'varReturn100', u'sdReturn100', u'avgReturn100']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqumGet(secID = "", ticker = "", monthEndDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深股票未复权月行情，在未复权日行情基础上计算，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param monthEndDate: 当月最后一个交易日，输入格式“YYYYMMDD”,secID、ticker、monthEndDate至少选择一个
    :param beginDate: 查询monthEndDate的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询monthEndDate的截止日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票当月是否开盘标记位：0-未开盘，1-有交易。 当月交易天数为0时属于未开盘。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqum.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        monthEndDate = monthEndDate.strftime('%Y%m%d')
    except:
        monthEndDate = monthEndDate.replace('-', '')
    requestString.append("&monthEndDate=%s"%(monthEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqumGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqumGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'monthBeginDate', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'return', u'turnoverRate', u'avgTurnoverRate', u'varReturn24', u'sdReturn24', u'avgReturn24', u'varReturn60', u'sdReturn60', u'avgReturn60']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqumAdjGet(secID = "", ticker = "", monthEndDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深股票前复权月行情，在前复权日行情基础上计算，包含经前复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。于除权除息日对历史行情的调整，更新时间为9:00前（含科创板）。
    
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param monthEndDate: 当月最后一个交易日，输入格式“YYYYMMDD”,secID、ticker、monthEndDate至少选择一个
    :param beginDate: 查询monthEndDate的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询monthEndDate的截止日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票当月是否开盘标记位：0-未开盘，1-有交易。 当月交易天数为0时属于未开盘。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqumAdj.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        monthEndDate = monthEndDate.strftime('%Y%m%d')
    except:
        monthEndDate = monthEndDate.replace('-', '')
    requestString.append("&monthEndDate=%s"%(monthEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqumAdjGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqumAdjGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'monthBeginDate', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'return', u'turnoverRate', u'avgTurnoverRate', u'varReturn24', u'sdReturn24', u'avgReturn24', u'varReturn60', u'sdReturn60', u'avgReturn60']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqumAdjAfGet(secID = "", ticker = "", monthEndDate = "", beginDate = "", endDate = "", isOpen = "", field = "", pandas = "1"):
    """
    获取沪深股票后复权月行情，在后复权日行情基础上计算，包含经后复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、monthEndDate至少选择一个
    :param monthEndDate: 当月最后一个交易日，输入格式“YYYYMMDD”,secID、ticker、monthEndDate至少选择一个
    :param beginDate: 查询monthEndDate的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询monthEndDate的截止日期，输入格式“YYYYMMDD”,可空
    :param isOpen: 股票当月是否开盘标记位：0-未开盘，1-有交易。 当月交易天数为0时属于未开盘。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqumAdjAf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        monthEndDate = monthEndDate.strftime('%Y%m%d')
    except:
        monthEndDate = monthEndDate.replace('-', '')
    requestString.append("&monthEndDate=%s"%(monthEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(isOpen, str) and not isinstance(isOpen, unicode):
        isOpen = str(isOpen)

    requestString.append("&isOpen=%s"%(isOpen))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqumAdjAfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqumAdjAfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'monthBeginDate', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'return', u'turnoverRate', u'avgTurnoverRate', u'varReturn24', u'sdReturn24', u'avgReturn24', u'varReturn60', u'sdReturn60', u'avgReturn60']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIborGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", currency = "", field = "", pandas = "1"):
    """
    获取每日银行间同业拆借利率，覆盖SHIBOR、LIBOR、HIBOR，包含拆借品种的证券编码、拆借日期、拆借币种、拆借利率等。SHIBOR、HIBOR更新时间为11:30，LIBOR更新时间为21:00。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param currency: 拆借币种代码，对应DataAPI.SysCodeGet.codeTypeID=10004,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIbor.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&currency=")
    if hasattr(currency,'__iter__') and not isinstance(currency, str):
        if len(currency) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currency
            requestString.append(None)
        else:
            requestString.append(','.join(currency))
    else:
        requestString.append(currency)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIborGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIborGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'currency', u'rate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','currency': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIBBonddGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取银行间现券交易日行情，包含开盘、最高、最低、收盘对应的净价及收益率等。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIBBondd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIBBonddGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIBBonddGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preClosePrice', u'preWAVGPrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'wAvgPrice', u'chgPct', u'turnoverVol', u'preCloseYield', u'preWAVGYield', u'openYield', u'highestYield', u'lowestYield', u'closeYield', u'wAvgYield', u'grossClosePrice', u'accrInterest', u'YTM']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktCBOMOGet(omoType, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取央行公开市场操作信息，包含正回购、逆回购、短期流动性调节工具交易等信息。数据更新时间随央行发布时间而变动。
    
    :param omoType: 公开市场操作交易方式,可以是列表
    :param beginDate: 查询operateDate起始日期，输入格式：YYYYMMDD,可空
    :param endDate: 查询operateDate截止日期，输入格式：YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktCBOMO.csv?ispandas=1&') 
    requestString.append("omoType=")
    if hasattr(omoType,'__iter__') and not isinstance(omoType, str):
        if len(omoType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = omoType
            requestString.append(None)
        else:
            requestString.append(','.join(omoType))
    else:
        requestString.append(omoType)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktCBOMOGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktCBOMOGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'omoTerm', u'operateDate', u'operateDueDate', u'publishDate', u'turnoverVol', u'tenderRate', u'omoType', u'tenderType', u'remark']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'omoTerm': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFxQtRateGet(currencyPair, beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取中国银行发布的人民币实时外汇牌价，包含现钞、现汇的买入价/卖出价等。
    
    :param currencyPair: 货币代码
    :param beginTime: 查询publishTime起始时间，格式为YYYYMMDDHHMMSS，如20160222093000,可空
    :param endTime: 查询publishTime截止时间，格式为YYYYMMDDHHMMSS，如20160222113000,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFxQtRate.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFxQtRateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFxQtRateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'currencyPairCn', u'publishTime', u'currencyBid', u'cashBid', u'currencyAsk', u'cashAsk', u'conversionPrice', u'partyID', u'partyFullName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','currencyPairCn': 'str','partyFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktChiborGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取存款类机构间同业拆借行情，包含开、高、低、收、加权利率等。只统计通过同业拆借中心交易系统达成的交易，若当日无成交，则无记录。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktChibor.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktChiborGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktChiborGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'preCloseRate', u'preCloseWRate', u'openRate', u'highestRate', u'lowestRate', u'closeRate', u'wRate', u'bpChg', u'dealAmount', u'turnoverValue', u'turnoverChg']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktRankListStocksGet(secID = "", ticker = "", abnormalTypeCD = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深交易所每日交易公开信息中的个股异动情况(龙虎榜)，包括证券代码、异动类型，异动日期、异动偏离值等。沪深公布时间可能会有差异（含科创板）。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、abnormalTypeCD、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、abnormalTypeCD、tradeDate至少选择一个
    :param abnormalTypeCD: 异动类型代码，可从参数集合获取DataAPI.SysCodeGet.codeTypeID=12006,可以是列表,secID、ticker、abnormalTypeCD、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、abnormalTypeCD、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktRankListStocks.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&abnormalTypeCD=")
    if hasattr(abnormalTypeCD,'__iter__') and not isinstance(abnormalTypeCD, str):
        if len(abnormalTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = abnormalTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(abnormalTypeCD))
    else:
        requestString.append(abnormalTypeCD)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktRankListStocksGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktRankListStocksGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'abnormalTypeCD', u'abnormalType', u'deviation', u'turnoverVol', u'turnoverValue', u'abnormalBeginDate', u'abnormalEndDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','abnormalType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktRankListSalesGet(secID = "", ticker = "", side = "", rank = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深交易所每日交易公开信息中的营业部买卖排名情况，包括证券代码、营业部名称、买卖方向、排名、买入金额、卖出金额等（含科创板）。沪深公布时间可能会有差异。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、side、rank、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、side、rank、tradeDate至少选择一个
    :param side: 买卖方向，B-买入；S-卖出,可以是列表,secID、ticker、side、rank、tradeDate至少选择一个
    :param rank: 排名，提供第1~5名的排名。以对应买卖方向的买入/卖出金额排名,可以是列表,secID、ticker、side、rank、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、side、rank、tradeDate至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktRankListSales.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&side=")
    if hasattr(side,'__iter__') and not isinstance(side, str):
        if len(side) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = side
            requestString.append(None)
        else:
            requestString.append(','.join(side))
    else:
        requestString.append(side)
    requestString.append("&rank=")
    if hasattr(rank,'__iter__') and not isinstance(rank, str):
        if len(rank) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = rank
            requestString.append(None)
        else:
            requestString.append(','.join(rank))
    else:
        requestString.append(rank)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktRankListSalesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktRankListSalesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'side', u'rank', u'sales', u'buyValue', u'sellValue', u'totalValue', u'abnormalTypeCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','side': 'str','sales': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktRefIrGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取货币市场参考利率指标，包含利率指标、利率项、指标代码、利率值等。内容覆盖上海证券交易所债券质押式回购定盘利率和中国外汇交易中心回购定盘利率、七天回购移动平均利率。其中，七天回购移动平均利率于2018年4月9日停止更新。上交所次日盘前更新，银行间T日中午更新。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截至日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktRefIr.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktRefIrGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktRefIrGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'sec_ID', u'secShortName', u'ticker', u'exchangeCD', u'tradeDate', u'rateType', u'rate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'sec_ID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str','rateType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktExTdShszGet(statsTypeCD = "", statsTypeClassCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深交易所股票、基金、债券成交概况，其中深交所股票提供行业的统计情况，包含总市值、总成交金额、上涨下跌数、总成交笔数等。交易所发布数据，更新可能会随发布时间有延迟。
    
    :param statsTypeCD: 统计角度编码,可以是列表,可空
    :param statsTypeClassCD: 角度类型细分编码,可以是列表,可空
    :param beginDate: 起始日期，格式为yyyymmdd,可空
    :param endDate: 截止日期，格式为yyyymmdd,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktExTdShsz.csv?ispandas=1&') 
    requestString.append("statsTypeCD=")
    if hasattr(statsTypeCD,'__iter__') and not isinstance(statsTypeCD, str):
        if len(statsTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(statsTypeCD))
    else:
        requestString.append(statsTypeCD)
    requestString.append("&statsTypeClassCD=")
    if hasattr(statsTypeClassCD,'__iter__') and not isinstance(statsTypeClassCD, str):
        if len(statsTypeClassCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsTypeClassCD
            requestString.append(None)
        else:
            requestString.append(','.join(statsTypeClassCD))
    else:
        requestString.append(statsTypeClassCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktExTdShszGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktExTdShszGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'statsTypeCD', u'statsType', u'statsTypeClassCD', u'statsTypeClass', u'exchangeCD', u'tradeDate', u'marketValue', u'negMarketValue', u'totalShares', u'floatShares', u'turnoverVol', u'turnoverValue', u'dealAmount', u'avgPE', u'turnoverRate', u'listSecNum', u'tradeSecNum', u'upSecNum', u'flatSecNum', u'downSecNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'statsTypeCD': 'str','statsType': 'str','statsTypeClassCD': 'str','statsTypeClass': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktExTdIbGet(tradeTypeCD = "", statsTypeClassCD = "", statsTypeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取中国外汇交易中心同业拆借日报、质押式回购日报、买断式回购日报、现券买卖日报的市场成交情况。该日报数据只统计通过同业拆借中心交易系统达成的交易。
    
    :param tradeTypeCD: 交易类型，同业拆借日报- chibor  质押式回购日报- repo买断式回购日报- orepo现券买卖日报- bond,可以是列表,可空
    :param statsTypeClassCD: 角度类型细分编码，可在DataAPI.SysCodeGet获得，令codeTypeID=12005,选择其中4~6位编码,可以是列表,可空
    :param statsTypeCD: 统计角度编码，可在DataAPI.SysCodeGet获得，令codeTypeID=12005,选择其中2~4位编码,可以是列表,可空
    :param beginDate: 起始日期，格式为yyyymmdd,可空
    :param endDate: 截止日期，格式为yyyymmdd,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktExTdIb.csv?ispandas=1&') 
    requestString.append("tradeTypeCD=")
    if hasattr(tradeTypeCD,'__iter__') and not isinstance(tradeTypeCD, str):
        if len(tradeTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(tradeTypeCD))
    else:
        requestString.append(tradeTypeCD)
    requestString.append("&statsTypeClassCD=")
    if hasattr(statsTypeClassCD,'__iter__') and not isinstance(statsTypeClassCD, str):
        if len(statsTypeClassCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsTypeClassCD
            requestString.append(None)
        else:
            requestString.append(','.join(statsTypeClassCD))
    else:
        requestString.append(statsTypeClassCD)
    requestString.append("&statsTypeCD=")
    if hasattr(statsTypeCD,'__iter__') and not isinstance(statsTypeCD, str):
        if len(statsTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(statsTypeCD))
    else:
        requestString.append(statsTypeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktExTdIbGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktExTdIbGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeTypeCD', u'statsTypeCD', u'statsType', u'statsTypeClassCD', u'statsTypeClass', u'tradeDate', u'dealAmount', u'dealChg', u'turnoverVol', u'turnoverVolChg', u'wRate', u'bpChg', u'tradableNum', u'tradingNum', u'involvedNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeTypeCD': 'str','statsTypeCD': 'str','statsType': 'str','statsTypeClassCD': 'str','statsTypeClass': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktUsequdGet(ticker = "", tradeDate = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取美股未复权日行情信息，包含开盘价、最高价、最低价、收盘价、成交量等。更新时间为次日11:00（北京时间）。
    
    :param ticker: 通用交易代码,可以是列表,ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,ticker、tradeDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktUsequd.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktUsequdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktUsequdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'exchangeCD', u'tradeDate', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktAdjfAfIntraDayGet(secID = "", ticker = "", exDivDate = "", field = "", pandas = "1"):
    """
    获取沪深股票用来调整历史行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及对应的生效日期区间。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在发生分红、配股、股改事件的除权除息日才有复权因子记录。因在盘前更新，收盘价尚未生成时，当日的后复权因子是用前复权因子计算的近似值。与getMktAdjfAfM的区别：提供成交量复权因子。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param ticker: 一只或多只股票代码，用,分隔，如000001,000002。,可以是列表,可空
    :param exDivDate: 除权除息日,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktAdjfAfIntraDay.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exDivDate=")
    if hasattr(exDivDate,'__iter__') and not isinstance(exDivDate, str):
        if len(exDivDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exDivDate
            requestString.append(None)
        else:
            requestString.append(','.join(exDivDate))
    else:
        requestString.append(exDivDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktAdjfAfIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktAdjfAfIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exDivDate', u'perCashDiv', u'perShareDivRatio', u'perShareTransRatio', u'allotmentRatio', u'allotmentPrice', u'adjFactor', u'accumAdjFactor', u'adjFactor3', u'accumAdjFactor3', u'adjFactor4', u'accumAdjFactor4']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktRANKInstTrGet(tradeDate = "", industryID = "", secID = "", industryName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票在申万一级行业中的换手率排名信息，每个行业取排名前三的个股，包含行业标准、行业代码、行业名称、证券代码、换手率、排名等（含科创板）。
    
    :param tradeDate: 交易日期,tradeDate、industryID、secID至少选择一个
    :param industryID: 通联编制的行业分类编码，可以通过getIndustry获取。申万一二三级行业分类：industryVersionCD=010303,可以是列表,tradeDate、industryID、secID至少选择一个
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,tradeDate、industryID、secID至少选择一个
    :param industryName: 行业名称，目前可输入申万一级行业名称,可空
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktRANKInstTr.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(industryName, str) and not isinstance(industryName, unicode):
        industryName = str(industryName)

    requestString.append("&industryName=%s"%(industryName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktRANKInstTrGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktRANKInstTrGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'turnoverRate', u'closePrice', u'industryID', u'industryName', u'industry', u'rank']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','industryID': 'str','industryName': 'str','industry': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxwGet(beginDate = "", endDate = "", indexID = "", ticker = "", field = "", pandas = "1"):
    """
    获取指数周线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。沪深重要指数的更新时间为16:30，其他指数因发布机构不同会陆续更新。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,beginDate、endDate、indexID、ticker至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,beginDate、endDate、indexID、ticker至少选择一个
    :param indexID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,beginDate、endDate、indexID、ticker至少选择一个
    :param ticker: 指数通用代码,可以是列表,beginDate、endDate、indexID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxw.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&indexID=")
    if hasattr(indexID,'__iter__') and not isinstance(indexID, str):
        if len(indexID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indexID
            requestString.append(None)
        else:
            requestString.append(','.join(indexID))
    else:
        requestString.append(indexID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxwGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxwGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indexID', u'ticker', u'secShortName', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'avgPrice', u'wAvgReturn', u'yReturn']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indexID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxmGet(beginDate = "", endDate = "", indexID = "", ticker = "", field = "", pandas = "1"):
    """
    获取指数月线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。沪深重要指数的更新时间为16:30，其他指数因发布机构不同会陆续更新。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,beginDate、endDate、indexID、ticker至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,beginDate、endDate、indexID、ticker至少选择一个
    :param indexID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,beginDate、endDate、indexID、ticker至少选择一个
    :param ticker: 指数通用代码,可以是列表,beginDate、endDate、indexID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxm.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&indexID=")
    if hasattr(indexID,'__iter__') and not isinstance(indexID, str):
        if len(indexID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indexID
            requestString.append(None)
        else:
            requestString.append(','.join(indexID))
    else:
        requestString.append(indexID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxmGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxmGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indexID', u'ticker', u'secShortName', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'avgPrice', u'mAvgReyurn', u'yReturn']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indexID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktVolAdjfGet(secID = "", ticker = "", beginDate = "", endDate = "", exchangeCD = "", exDivDate = "", field = "", pandas = "1"):
    """
    获取沪深股票用来调整历史行情的成交量复权因子，包含单次和累积成交量前/后复权因子。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在发生分红、配股、股改事件的除权除息日才有复权因子记录。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param beginDate: 除权除息日的起始查询日期,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param endDate: 除权除息日的截止查询日期,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param exDivDate: 除权除息日，股改对应股改后首个交易日，输入格式：YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktVolAdjf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        exDivDate = exDivDate.strftime('%Y%m%d')
    except:
        exDivDate = exDivDate.replace('-', '')
    requestString.append("&exDivDate=%s"%(exDivDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktVolAdjfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktVolAdjfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'exDivDate', u'preShareDivRatio', u'perShareTransRatio', u'allotmentRatio', u'splitsRatio', u'adjFactor3', u'accumAdjFactor3', u'adjFactor4', u'accumAdjFactor4', u'endDateAdjf', u'endDateAf', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutwGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取国内期货周行情，在期货日行情基础上计算，包含前收价、前结算、开盘价、最高价、最低价、收盘价、结算价、持仓量、成交量、成交金额等字段。当日无成交的合约不计算。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询endDate起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询endDate截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutw.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutwGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutwGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'preSettlePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlePrice', u'turnoverVol', u'turnoverVolChg', u'turnoverValue', u'turnoverValueChg', u'openInt', u'openIntChg', u'chg', u'chg1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutmGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取国内期货月行情，在期货日行情基础上计算，包含前收价、前结算、开盘价、最高价、最低价、收盘价、结算价、持仓量、成交量、成交金额等字段。当日无成交的合约不计算。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询endDate起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询endDate截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutm.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutmGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutmGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'preSettlePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlePrice', u'turnoverVol', u'turnoverVolChg', u'turnoverValue', u'turnoverValueChg', u'openInt', u'openIntChg', u'chg', u'chg1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktAdjfAfMGet(secID = "", ticker = "", exDivDate = "", field = "", pandas = "1"):
    """
    获取沪深股票用来调整历史行情的后复权因子数据（以上市价格为基准），包含除权除息日、除权除息事项具体数据、本次复权因子、累积复权因子以及对应的生效日期区间。该因子用来调整历史行情，不作为预测使用，于除权除息日进行计算调整。只在发生分红、配股、股改事件的除权除息日才有复权因子记录。因在盘前更新，收盘价尚未生成时，当日的后复权因子是用前复权因子计算的近似值。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、exDivDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、exDivDate至少选择一个
    :param exDivDate: 除权除息日，股改对应股改后首个交易日，输入格式：YYYYMMDD,可以是列表,secID、ticker、exDivDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktAdjfAfM.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exDivDate=")
    if hasattr(exDivDate,'__iter__') and not isinstance(exDivDate, str):
        if len(exDivDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exDivDate
            requestString.append(None)
        else:
            requestString.append(','.join(exDivDate))
    else:
        requestString.append(exDivDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktAdjfAfMGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktAdjfAfMGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exDivDate', u'perCashDiv', u'perShareDivRatio', u'perShareTransRatio', u'allotmentRatio', u'allotmentPrice', u'adjFactor', u'accumAdjFactor']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktCmeFutdGet(ticker = "", tradeDate = "", beginDate = "", endDate = "", contractObject = "", field = "", pandas = "1"):
    """
    获取CME Group所有期货合约日行情信息，包含芝加哥商业交易所 (CME)、 芝加哥期货交易所(CBOT)、纽约商业交易所 (NYMEX)、纽约商品交易所 (COMEX)。
    
    :param ticker: 通用交易代码,可以是列表,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param tradeDate: 交易日期,可以是列表,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param beginDate: 查询起始交易日期，格式为yyyymmdd,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param endDate: 查询截止交易日期，格式为yyyymmdd,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param contractObject: 期货品种代码，其中TAS表示Trade at Settlement,可以是列表,ticker、tradeDate、beginDate、endDate、contractObject至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktCmeFutd.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&contractObject=")
    if hasattr(contractObject,'__iter__') and not isinstance(contractObject, str):
        if len(contractObject) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractObject
            requestString.append(None)
        else:
            requestString.append(','.join(contractObject))
    else:
        requestString.append(contractObject)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktCmeFutdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktCmeFutdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'tradeDate', u'deliYear', u'deliMonth', u'deliDate', u'secFullName', u'contractObject', u'preSettlePrice', u'preOpenInt', u'openPrice', u'highestPrice', u'highestPriceSide', u'lowestPrice', u'lowestPriceSide', u'closePrice', u'closePriceSide', u'settlePrice', u'chg', u'turnoverVol']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secFullName': 'str','contractObject': 'str','highestPriceSide': 'str','lowestPriceSide': 'str','closePriceSide': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutLimitGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取期货合约每个交易日的涨停价和跌停价信息，商品交易所T-1日21:00更新，中金所T日9:00更新。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutLimit.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutLimitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutLimitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDATE', u'limitUpPrice', u'limitDownPrice']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIpoConTraddaysGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票在新股阶段的连板信息，包含2010年以后上市的股票，包括连板天数及连板收益率等。每只新股一条记录，自上市首日起持续更新，直至收盘时未收获连板（含科创板）。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIpoConTraddays.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIpoConTraddaysGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIpoConTraddaysGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'listDate', u'issuePrice', u'firstDayClosePrice', u'firstDayChgPct', u'breakConClosePrice', u'continiousTradDays', u'conReturn', u'isContinue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxFactorOneDayGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取多个指数历史上某一天的因子数据
    
    :param tradeDate: 交易日期
    :param secID: 多个指数ID，用逗号隔开,可以是列表,可空
    :param ticker: 多个指数代码，用逗号隔开,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxFactorOneDay.csv?ispandas=1&') 
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxFactorOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxFactorOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'tradeDate', u'ticker', u'ChgPct', u'Close', u'DownPct', u'LimitDownPct', u'LimitUpPct', u'MA5', u'MA10', u'MA20', u'MA60', u'MA120', u'MACD', u'DIFF', u'DEA', u'PB1', u'PB2', u'PE1', u'PE2', u'RSI12', u'TurnoverValue', u'TurnoverVol', u'UpPct', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxFactorDateRangeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取一个指数历史上某一时间段的因子数据
    
    :param secID: 一个指数ID,secID、ticker至少选择一个
    :param ticker: 一个指数代码,secID、ticker至少选择一个
    :param beginDate: 开始日期,可空
    :param endDate: 结束日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxFactorDateRange.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxFactorDateRangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxFactorDateRangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'tradeDate', u'ticker', u'ChgPct', u'Close', u'DownPct', u'LimitDownPct', u'LimitUpPct', u'MA5', u'MA10', u'MA20', u'MA60', u'MA120', u'MACD', u'DIFF', u'DEA', u'PB1', u'PB2', u'PE1', u'PE2', u'RSI12', u'TurnoverValue', u'TurnoverVol', u'UpPct', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktGEMEvaluateGet(beginDate, endDate, field = "", pandas = "1"):
    """
    获取每日创业板估值信息，即每日动态市盈率处于不同水平的股票数量，包含四种标准：50以下（含）、100以下（含）、200以下（含）、200以上（不含）。动态市盈率的逻辑为：总市值/归属于母公司所有者的净利润（最新一期财报年化）。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktGEMEvaluate.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktGEMEvaluateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktGEMEvaluateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'numUnder50', u'numUnder100', u'numUnder150', u'numUnder200', u'numOver200']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutOiRatioGet(contractObject, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取期货品种每日多空持仓占比情况，包含每个品种的持买量、持卖量及持卖量比持买量。基于合约持仓排名计算，更新时间可能因发布情况而延迟。
    
    :param contractObject: 查询tradeDate截止日期，输入格式“YYYYMMDD”,可以是列表
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutOiRatio.csv?ispandas=1&') 
    requestString.append("contractObject=")
    if hasattr(contractObject,'__iter__') and not isinstance(contractObject, str):
        if len(contractObject) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractObject
            requestString.append(None)
        else:
            requestString.append(','.join(contractObject))
    else:
        requestString.append(contractObject)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutOiRatioGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutOiRatioGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'contractObject', u'contractObjectCn', u'tradeDate', u'longOpenInt', u'shortOpenInt', u'ratio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'contractObject': 'str','contractObjectCn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutIdxBasisGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取中金所股指期货每日升贴水信息，包含期货价格、对应股指点位及升贴水等。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 期货通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutIdxBasis.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutIdxBasisGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutIdxBasisGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'exchangeCD', u'tradeDate', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'indexID', u'indexSymbol', u'closeIndex', u'basis']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str','indexSymbol': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxdEvalGet(secID = "", ticker = "", beginDate = "", endDate = "", PEType = "", field = "", pandas = "1"):
    """
    获取指数估值信息，包含指数总市值、流通市值、指数市盈率、指数市净率、ROE、成分股涨跌数等信息。请注意：净利润与市值不含PE为负或大于1000的成分股；成分中含B股的，换算为CNY。
    
    :param secID: 指数的证券编码，可使用DataAPI.SecIDGet接口获取到,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 指数的通用代码，目前涵盖47个指数：DY0001-通联全A,000001-上证综指,000009-上证380,000010-上证180,000016-上证50,000068-上证资源,000300-沪深300,000807-中证食品饮料,000827-中证环保,000852-中证1000,000903-中证100,000905-中证500,000906-中证800,000922-中证红利,000925-中证基本面50,000928-中证能源,000932-中证消费,000933-中证医药,000934-中证金融,000944-中证内地资源,000986-中证全指能源,000987-中证全指材料,000988-中证全指工业,000989-中证全指可选,000990-中证全指消费,000991-中证全指医药,000992-中证全指金融,000993-中证全指信息,000998-中证TMT,399001-深证成指,399005-深证中小板指,399006-深证创业板指,399101-深证中小板综,399102-深证创业板综,399324-深证红利,399330-深证100,399396-国证食品,399550-国证央视50,399606-深证创业板R,399610-深证TMT50,399812-中证养老产业,399814-中证大农业,399959-中证军工指数,399971-中证传媒,399983-中证地产等权,399997-中证白酒,399998-中证煤炭。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param PEType: PE类型，1--市盈率ttm；2--动态市盈率,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxdEval.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&PEType=")
    if hasattr(PEType,'__iter__') and not isinstance(PEType, str):
        if len(PEType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = PEType
            requestString.append(None)
        else:
            requestString.append(','.join(PEType))
    else:
        requestString.append(PEType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxdEvalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxdEvalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'progFullName', u'secShortName', u'exchangeCD', u'tradeDate', u'indexMarketValue', u'indexIncome', u'indexAttrP', u'PEValue', u'PEType', u'PB', u'ROE', u'indexValue', u'negIndexValue', u'turnoverRate', u'upNum', u'downNum', u'equalNum', u'divYield']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','progFullName': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIndustryEvalGet(beginDate, endDate, industryID = "", PEType = "", field = "", pandas = "1"):
    """
    获取申万一二三级行业估值信息，包含市值、市盈率、市净率等信息。市盈率的算法包含行业成分去极值与负值的条件。
    
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”
    :param industryID: 通联编制的行业分类编码，可以通过getIndustry获取,可以是列表,可空
    :param PEType: PE类型，1-市盈率TTM；2-动态市盈率,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIndustryEval.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    requestString.append("&PEType=")
    if hasattr(PEType,'__iter__') and not isinstance(PEType, str):
        if len(PEType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = PEType
            requestString.append(None)
        else:
            requestString.append(','.join(PEType))
    else:
        requestString.append(PEType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIndustryEvalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIndustryEvalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'industryID', u'industryName', u'tradeDate', u'industryMarketValue', u'industryIncome', u'industryAttrP', u'PEValue', u'PEType', u'PB']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industryID': 'str','industryName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktRankDivYieldGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深A股的股息率排名信息，包含近一年总分红、股息率、当日排名等，不含近一年无分红的股票。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktRankDivYield.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktRankDivYieldGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktRankDivYieldGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'closePrice', u'sumDivTTM', u'divRate', u'rank', u'marketVlalue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktConsBondPremiumGet(SecID = "", tickerBond = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取可转债折溢价信息，包含每日可转债价格、正股价格、可转债折溢价等。
    
    :param SecID: 可转债的通联编制证券编码，可通过DataAPI.SecIDGet获取,可以是列表,SecID、tickerBond、beginDate、endDate至少选择一个
    :param tickerBond: 可转债通用交易代码,可以是列表,SecID、tickerBond、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,SecID、tickerBond、beginDate、endDate至少选择一个
    :param endDate: 查询起始日期，格式为YYYYMMDD,SecID、tickerBond、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktConsBondPremium.csv?ispandas=1&') 
    requestString.append("SecID=")
    if hasattr(SecID,'__iter__') and not isinstance(SecID, str):
        if len(SecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = SecID
            requestString.append(None)
        else:
            requestString.append(','.join(SecID))
    else:
        requestString.append(SecID)
    requestString.append("&tickerBond=")
    if hasattr(tickerBond,'__iter__') and not isinstance(tickerBond, str):
        if len(tickerBond) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tickerBond
            requestString.append(None)
        else:
            requestString.append(','.join(tickerBond))
    else:
        requestString.append(tickerBond)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktConsBondPremiumGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktConsBondPremiumGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'SecID', u'tickerBond', u'secShortNameBond', u'tradeDate', u'closePriceBond', u'tickerEqu', u'secShortNameEqu', u'closePriceEqu', u'convPrice', u'bondPremDisc']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'SecID': 'str','tickerBond': 'str','secShortNameBond': 'str','tickerEqu': 'str','secShortNameEqu': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktNeeqEqudGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取新三板股票未复权日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktNeeqEqud.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktNeeqEqudGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktNeeqEqudGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'exchangeCD', u'tradeDate', u'preClosePrice', u'actPreClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'marketValue', u'negMarketValue', u'chgPct', u'rangePct', u'turnoverRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktNeeqDpoGet(SecID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取每日新三板盘前静态信息，包含每只证券当日的基本信息，如证券代码、证券简称、挂牌日期、每股收益、总股本、无限售股份、买卖数量单位、最小价格变动单位、涨跌停价格、除权除息标识等。
    
    :param SecID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,SecID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,SecID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,SecID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,SecID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktNeeqDpo.csv?ispandas=1&') 
    requestString.append("SecID=")
    if hasattr(SecID,'__iter__') and not isinstance(SecID, str):
        if len(SecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = SecID
            requestString.append(None)
        else:
            requestString.append(','.join(SecID))
    else:
        requestString.append(SecID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktNeeqDpoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktNeeqDpoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'SecID', u'secShortName', u'ticker', u'exchangeCD', u'tradeDate', u'transUnit', u'industryCategory', u'par', u'baseTicker', u'totalShares', u'nonrestFloatShares', u'EPSLy', u'listDate', u'firstAccrDate', u'perDealLimit', u'bidUnit', u'askUnit', u'fdTransLimitCd', u'dTransLimitCd', u'transLimitCdType', u'limitUpPrice', u'limitDownPrice', u'blockLimitUpPrice', u'blockLimitDownPrice', u'divRatio', u'transStatus', u'equType', u'transType', u'marketMakerVol', u'haltSymbol', u'divSymbol']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'SecID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str','industryCategory': 'str','baseTicker': 'str','transStatus': 'str','equType': 'str','transType': 'str','haltSymbol': 'str','divSymbol': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktSubnewEqudGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深次新股日行情信息，包含证券编码、所属板块、昨收盘、开盘价、最高价、最低价、收盘价、成交量、成交金额、成交笔数、涨跌幅、市盈率、换手率等。次新股定义：上市时间已满两个月但未满一年，并且还没有分红的上市公司。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktSubnewEqud.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktSubnewEqudGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktSubnewEqudGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'boardID', u'boardName', u'tradeDate', u'preClosePrice', u'actPreClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'dealAmount', u'PE', u'PE1', u'PB', u'negMarketValue', u'marketValue', u'chgPct', u'turnoverRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','boardID': 'str','boardName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktAHCompdGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取每日AH同时上市的股票比价信息，包含A股收盘价、H股收盘价以及H股占A股比例等。
    
    :param secID: 通联编制的A股证券编码， 可通过DataAPI.SecIDGet获取。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: A股通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktAHCompd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktAHCompdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktAHCompdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secIDA', u'tradeDate', u'tickerA', u'tickerH', u'secShortNameA', u'secShortNameH', u'closePriceA', u'closePriceH', u'closePriceHA', u'chgPctA', u'chgPctH', u'ahRatio', u'turnoverVolA', u'turnoverVolH']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secIDA': 'str','tickerA': 'str','tickerH': 'str','secShortNameA': 'str','secShortNameH': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxPerformanceGet(SecID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取指数在一段日期内的收益率统计数据，包含近一个月/季/年/N年的平均收益率，收益率标准差和夏普比率等。沪深重要指数的更新时间为17:00，其他指数因发布机构不同会陆续更新。
    
    :param SecID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,SecID、ticker至少选择一个
    :param ticker: 指数通用代码,SecID、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxPerformance.csv?ispandas=1&') 
    if not isinstance(SecID, str) and not isinstance(SecID, unicode):
        SecID = str(SecID)

    requestString.append("SecID=%s"%(SecID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxPerformanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxPerformanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'SecID', u'ticker', u'tradeDate', u'avgReturn1M', u'avgReturn3M', u'avgReturn6M', u'avgReturn1Y', u'avgReturn2Y', u'avgReturn3Y', u'avgReturn4Y', u'avgReturn5Y', u'avgReturn6Y', u'avgReturnShis', u'stdDev6M', u'stdDev1Y', u'stdDev2Y', u'stdDev3Y', u'sharpRatio6M', u'sharpRatio1Y', u'sharpRatio2Y', u'sharpRatio3Y']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'SecID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktNeeqEquwGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取新三板股票周行情信息，由日行情衍生，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktNeeqEquw.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktNeeqEquwGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktNeeqEquwGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'weekBeginDate', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'wReturn', u'wVarReturn100', u'wSdReturn100', u'wAvgReturn100']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktNeeqEqumGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取新三板股票月行情信息，由日行情衍生，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktNeeqEqum.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktNeeqEqumGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktNeeqEqumGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'monthBeginDate', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'mReturn', u'mVarReturn24', u'mSdReturn24', u'mAvgReturn24', u'mVarReturn60', u'mSdReturn60', u'mAvgReturn60']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIndustryQuoteGet(tradeDate = "", beginDate = "", endDate = "", industryID = "", statsFreq = "", field = "", pandas = "1"):
    """
    获取申万三级行业板块区间行情信息，区间维度包含1日、5日、10日、30日、60日、90日、180日、360日、720日、1080日，区间行情的计算方式主要包含算数平均、总市值加权、流通市值加权等。
    
    :param tradeDate: 交易日期,tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param industryID: 通联编制的行业分类编码，可以通过getIndustry获取。申万三级行业分类：industryVersionCD=010303,industryLevel=2,可以是列表,可空
    :param statsFreq: 统计周期，可输入1、5、10、30、60、90、180、360、720、1080,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIndustryQuote.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    if not isinstance(statsFreq, str) and not isinstance(statsFreq, unicode):
        statsFreq = str(statsFreq)

    requestString.append("&statsFreq=%s"%(statsFreq))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIndustryQuoteGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIndustryQuoteGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'industryID', u'industryName', u'tradeDate', u'statsFreq', u'varVol', u'openPriceAvg', u'hightestPriceAvg', u'lowestPriceAvg', u'closePriceAvg', u'openPriceTsW', u'highestPriceTsW', u'lowestPriceTsW', u'closePriceTsW', u'openPriceNfaW', u'highestPriceNfaW', u'lowestPriceNfaW', u'closePriceNfaW', u'turnoverVol', u'turnoverValue', u'chgPctAvg', u'chgPctMvW', u'chgPctNmvW', u'turnoverRateAvg', u'turnoverRateMvW', u'turnoverRateNmvW', u'totalMarketValue', u'marketValueAvg', u'totalNegMarketValue', u'negMarketValueAvg']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industryID': 'str','industryName': 'str','statsFreq': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktConOptMSRGet(tradeDate = "", beginDate = "", endDate = "", secID = "", ticker = "", contractType = "", field = "", pandas = "1"):
    """
    获取每日商品期权会员持卖仓排名信息，覆盖大商所及郑商所，包含标的代码、期权合约类型、持卖仓量、持卖仓量增减、当日排名等。只公布标的期货总持仓量达到一定标准的活跃合约对应的期权系列，详见交易所相关规则。
    
    :param tradeDate: 交易日期,tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param endDate: 查询tradeDate截止日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param secID: 标的合约对应通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 标的合约对应通用交易代码,可以是列表,可空
    :param contractType: 期权合约类型，CO-看涨期权；PO-看跌期权,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktConOptMSR.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&contractType=")
    if hasattr(contractType,'__iter__') and not isinstance(contractType, str):
        if len(contractType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractType
            requestString.append(None)
        else:
            requestString.append(','.join(contractType))
    else:
        requestString.append(contractType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktConOptMSRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktConOptMSRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'contractType', u'partyShortName', u'exchangeCD', u'tradeDate', u'shortOpenInt', u'chg', u'rank']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','contractType': 'str','partyShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktConOptMLRGet(tradeDate = "", beginDate = "", endDate = "", secID = "", ticker = "", contractType = "", field = "", pandas = "1"):
    """
    获取每日商品期权会员持买仓排名信息，覆盖大商所及郑商所，包含标的代码、期权合约类型、持买仓量、持买仓量增减、当日排名等。只公布标的期货总持仓量达到一定标准的活跃合约对应的期权系列，详见交易所相关规则。
    
    :param tradeDate: 交易日期,tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param endDate: 查询tradeDate截止日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param secID: 标的合约对应通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 标的合约对应通用交易代码,可以是列表,可空
    :param contractType: 期权合约类型，CO-看涨期权；PO-看跌期权,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktConOptMLR.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&contractType=")
    if hasattr(contractType,'__iter__') and not isinstance(contractType, str):
        if len(contractType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractType
            requestString.append(None)
        else:
            requestString.append(','.join(contractType))
    else:
        requestString.append(contractType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktConOptMLRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktConOptMLRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'contractType', u'partyShortName', u'exchangeCD', u'tradeDate', u'longOpenInt', u'chg', u'rank']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','contractType': 'str','partyShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktConOptMTRGet(tradeDate = "", beginDate = "", endDate = "", secID = "", ticker = "", contractType = "", field = "", pandas = "1"):
    """
    获取每日商品期权会员成交量排名信息，覆盖大商所及郑商所，包含标的代码、期权合约类型、成交量、成交量增减、当日排名等。只公布标的期货总持仓量达到一定标准的活跃合约对应的期权系列，详见交易所相关规则。
    
    :param tradeDate: 交易日期,tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param endDate: 查询tradeDate截止日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param secID: 标的合约对应通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 标的合约对应通用交易代码,可以是列表,可空
    :param contractType: 期权合约类型，CO-看涨期权；PO-看跌期权,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktConOptMTR.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&contractType=")
    if hasattr(contractType,'__iter__') and not isinstance(contractType, str):
        if len(contractType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractType
            requestString.append(None)
        else:
            requestString.append(','.join(contractType))
    else:
        requestString.append(contractType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktConOptMTRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktConOptMTRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'contractType', u'partyShortName', u'exchangeCD', u'tradeDate', u'turnoverVol', u'chg', u'rank']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','contractType': 'str','partyShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxqGet(secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取指数季线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。沪深重要指数的更新时间为16:30，其他指数因发布机构不同会陆续更新。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxq.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxqGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxqGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indexID', u'ticker', u'secShortName', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'avgPrice', u'qAvgReyurn']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indexID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxsGet(secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取指数半年线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。沪深重要指数的更新时间为16:30，其他指数因发布机构不同会陆续更新。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxs.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indexID', u'ticker', u'secShortName', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'avgPrice', u'sAvgReyurn']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indexID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxaGet(secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取指数年线行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。沪深重要指数的更新时间为16:30，其他指数因发布机构不同会陆续更新。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxa.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indexID', u'ticker', u'secShortName', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'avgPrice', u'aAvgReyurn']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indexID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquqGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票未复权季行情，在未复权日行情基础上计算，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquq.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquqGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquqGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquqAdjGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票前复权季行情，在前复权日行情基础上计算，包含经前复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。于除权除息日对历史行情的调整，更新时间为9:30前（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquqAdj.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquqAdjGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquqAdjGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquqAdjAfGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票后复权季行情，在后复权日行情基础上计算，包含经后复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquqAdjAf.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquqAdjAfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquqAdjAfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqusGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票未复权半年行情，在未复权日行情基础上计算，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqus.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqusGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqusGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqusAdjGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票前复权半年行情，在前复权日行情基础上计算，包含经前复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。于除权除息日对历史行情的调整，更新时间为9:30前（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqusAdj.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqusAdjGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqusAdjGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqusAdjAfGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票后复权半年行情，在后复权日行情基础上计算，包含经后复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqusAdjAf.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqusAdjAfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqusAdjAfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquaGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票未复权年行情，在未复权日行情基础上计算，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqua.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquaAdjGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票前复权年行情，在前复权日行情基础上计算，包含经前复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。于除权除息日对历史行情的调整，更新时间为9:30前（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquaAdj.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquaAdjGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquaAdjGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquaAdjAfGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取沪深股票后复权年行情，在后复权日行情基础上计算，包含经后复权调整的昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段（含科创板）。
    
    :param beginDate: 查询endDate的起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate的截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码， 可使用DataAPI.SecIDGet接口获取到,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquaAdjAf.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquaAdjAfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquaAdjAfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutqGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取国内期货季行情，在期货日行情基础上计算，包含前收价、前结算、开盘价、最高价、最低价、收盘价、结算价、持仓量、成交量、成交金额等字段。当日无成交的合约不计算。
    
    :param beginDate: 查询endDate起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutq.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutqGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutqGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'preSettlePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlePrice', u'turnoverVol', u'turnoverVolChg', u'turnoverValue', u'turnoverValueChg', u'openInt', u'openIntChg']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutsGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取国内期货半年行情，在期货日行情基础上计算，包含前收价、前结算、开盘价、最高价、最低价、收盘价、结算价、持仓量、成交量、成交金额等字段。当日无成交的合约不计算。
    
    :param beginDate: 查询endDate起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFuts.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'preSettlePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlePrice', u'turnoverVol', u'turnoverVolChg', u'turnoverValue', u'turnoverValueChg', u'openInt', u'openIntChg']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutaGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取国内期货年行情，在期货日行情基础上计算，包含前收价、前结算、开盘价、最高价、最低价、收盘价、结算价、持仓量、成交量、成交金额等字段。当日无成交的合约不计算。
    
    :param beginDate: 查询endDate起始日期，输入格式“YYYYMMDD”
    :param endDate: 查询endDate截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFuta.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tradeDays', u'preClosePrice', u'preSettlePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlePrice', u'turnoverVol', u'turnoverVolChg', u'turnoverValue', u'turnoverValueChg', u'openInt', u'openIntChg']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktHKCbbcdGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取港交所牛熊证日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等字段。
    
    :param tradeDate: 交易日期
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktHKCbbcd.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktHKCbbcdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktHKCbbcdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'exchangeCD', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktHKDwdGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取港交所权证日行情信息，包含昨收价、开盘价、最高价、最低价、收盘价、成交量、成交金额等。
    
    :param tradeDate: 交易日期
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktHKDwd.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktHKDwdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktHKDwdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'exchangeCD', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEquPerfGet(adjType, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取股票每日最新表现，只提供最新交易日的数据，包含股票一段日期内的涨跌幅，如周、月、季、年等。两种复权类型中推荐使用前复权以更准确的跟踪长期收益率，未复权仅供参考（含科创板）。
    
    :param adjType: 复权类型：1-未复权，2-前复权
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEquPerf.csv?ispandas=1&') 
    if not isinstance(adjType, str) and not isinstance(adjType, unicode):
        adjType = str(adjType)

    requestString.append("adjType=%s"%(adjType))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEquPerfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEquPerfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'adjType', u'chgPct', u'chgPct1W', u'chgPctFw', u'chgPct1M', u'chgPctFm', u'chgPct3M', u'chgPct6M', u'chgPct1Y', u'chgPctFy', u'chgPctFl', u'chgPctSm', u'chgPctTm']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktComIdxdGet(secID = "", ticker = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取商品指数日行情，涵盖大连商品交易所、上海期货交易所、郑州商品交易所及通联数据自主计算的商品指数日行情信息，包含前收盘价、前结算价、开盘价、最高价、最低价、收盘价、结算价、均价、成交量、成交金额、涨跌、涨跌幅等。更新时间因发布机构不同，大商所及郑商所-16:40，通联-17:20，上期所18:00。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的交易市场编码,可以是列表,secID、ticker、beginDate、endDate、exchangeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktComIdxd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktComIdxdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktComIdxdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCd', u'tradeDate', u'preClosePrice', u'preSettlePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'settlePrice', u'averagePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktBondVwapdGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深交易所债券每日VWAP价格
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 开始日期，格式为YYYYMMDD,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 截止日期，格式为YYYYMMDD,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktBondVwapd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktBondVwapdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktBondVwapdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'VWAP']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktHKEqudAdjGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取港交所股票前复权日行情信息，包含昨收盘价、开盘价、最高价、最低价、收盘价、成交量、成交金额等。有除权除息事件的股票，会在除权除息日对历史行情进行前复权调整。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktHKEqudAdj.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktHKEqudAdjGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktHKEqudAdjGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktInstEqudGet(industrySymbol = "", secID = "", indexSymbol = "", tradeDate = "", industryID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    行业板块行情信息，根据申万一级、二级、三级行业成分计算，包含当日开盘价、最高价、最低价、收盘价、成交量、领涨股、涨股数、达到涨停股数、资金净流入、主力资金净流入额等信息。
    
    :param industrySymbol: 申万行业代码，可从接口getIndustry获取,可以是列表,industrySymbol、secID、indexSymbol、tradeDate、industryID至少选择一个
    :param secID: 行业对应的申万指数内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,industrySymbol、secID、indexSymbol、tradeDate、industryID至少选择一个
    :param indexSymbol: 申万行业对应的指数代码,可以是列表,industrySymbol、secID、indexSymbol、tradeDate、industryID至少选择一个
    :param tradeDate: 交易日期,industrySymbol、secID、indexSymbol、tradeDate、industryID至少选择一个
    :param industryID: 通联编制的行业分类编码，可以通过getIndustry获取。申万一二三级行业分类：industryVersionCD=010303,可以是列表,industrySymbol、secID、indexSymbol、tradeDate、industryID至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktInstEqud.csv?ispandas=1&') 
    requestString.append("industrySymbol=")
    if hasattr(industrySymbol,'__iter__') and not isinstance(industrySymbol, str):
        if len(industrySymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industrySymbol
            requestString.append(None)
        else:
            requestString.append(','.join(industrySymbol))
    else:
        requestString.append(industrySymbol)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&indexSymbol=")
    if hasattr(indexSymbol,'__iter__') and not isinstance(indexSymbol, str):
        if len(indexSymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indexSymbol
            requestString.append(None)
        else:
            requestString.append(','.join(indexSymbol))
    else:
        requestString.append(indexSymbol)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktInstEqudGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktInstEqudGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'industrySymbol', u'industryName', u'secID', u'indexSymbol', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chgPct', u'ticker', u'upNum', u'downNum', u'equalNum', u'upLimitNum', u'downLimitNum', u'turnoverRate', u'netInflow', u'netMainInflow', u'industryID', u'chgPct5', u'chgPct10', u'chgPct20', u'chgPctFY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industrySymbol': 'str','industryName': 'str','secID': 'str','indexSymbol': 'str','ticker': 'str','industryID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktInstConsRatioGet(typeID = "", industrySymbol = "", indexSymbol = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取申万一级行业对上证综指及创业板指的贡献度及权重信息，包含行业对指数涨跌的贡献度及行业占板块的权重等。更新时间可能随指数权重而延迟。
    
    :param typeID: 通联编制的行业分类编码，可以通过getIndustry获取。申万一级行业分类：industryVersionCD=010303，industryLevel=1,可以是列表,typeID、industrySymbol、indexSymbol、ticker、tradeDate至少选择一个
    :param industrySymbol: 申万行业代码,可以是列表,typeID、industrySymbol、indexSymbol、ticker、tradeDate至少选择一个
    :param indexSymbol: 申万行业对应的指数代码,可以是列表,typeID、industrySymbol、indexSymbol、ticker、tradeDate至少选择一个
    :param ticker: 指数交易代码，目前支持上证综指000001和创业板指399006,typeID、industrySymbol、indexSymbol、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,typeID、industrySymbol、indexSymbol、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktInstConsRatio.csv?ispandas=1&') 
    requestString.append("typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&industrySymbol=")
    if hasattr(industrySymbol,'__iter__') and not isinstance(industrySymbol, str):
        if len(industrySymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industrySymbol
            requestString.append(None)
        else:
            requestString.append(','.join(industrySymbol))
    else:
        requestString.append(industrySymbol)
    requestString.append("&indexSymbol=")
    if hasattr(indexSymbol,'__iter__') and not isinstance(indexSymbol, str):
        if len(indexSymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indexSymbol
            requestString.append(None)
        else:
            requestString.append(','.join(indexSymbol))
    else:
        requestString.append(indexSymbol)
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktInstConsRatioGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktInstConsRatioGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeID', u'industryName', u'industrySymbol', u'indexSymbol', u'tradeDate', u'indexID', u'ticker', u'consRatio', u'weight']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeID': 'str','industryName': 'str','industrySymbol': 'str','indexSymbol': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktConsBondPerfGet(beginDate, endDate, secID = "", tickerBond = "", tickerEqu = "", field = "", pandas = "1"):
    """
    获取可转换债券每日市场表现数据，包含正股代码、正股名称、发行额(亿元)、剩余规模(亿元)、转债价格、转股价格、正股价格、赎回触发价格、今日涨跌、转债过去一周涨幅、平价/转股溢价率(%)、债底/纯债价值、纯债溢价率等。
    
    :param beginDate: 查询起始日期，格式为YYYYMMDD
    :param endDate: 查询起始日期，格式为YYYYMMDD
    :param secID: 可转债的通联编制证券编码，可通过DataAPI.SecIDGet获取,可以是列表,secID、tickerBond、tickerEqu至少选择一个
    :param tickerBond: 可转债通用交易代码,可以是列表,secID、tickerBond、tickerEqu至少选择一个
    :param tickerEqu: 正股通用交易代码,可以是列表,secID、tickerBond、tickerEqu至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktConsBondPerf.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&tickerBond=")
    if hasattr(tickerBond,'__iter__') and not isinstance(tickerBond, str):
        if len(tickerBond) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tickerBond
            requestString.append(None)
        else:
            requestString.append(','.join(tickerBond))
    else:
        requestString.append(tickerBond)
    requestString.append("&tickerEqu=")
    if hasattr(tickerEqu,'__iter__') and not isinstance(tickerEqu, str):
        if len(tickerEqu) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tickerEqu
            requestString.append(None)
        else:
            requestString.append(','.join(tickerEqu))
    else:
        requestString.append(tickerEqu)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktConsBondPerfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktConsBondPerfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'tickerBond', u'secShortNameBond', u'tickerEqu', u'secShortNameEqu', u'tradeDate', u'totalSize', u'remainSize', u'closePriceBond', u'convPrice', u'closePriceEqu', u'exerPar', u'chgPct', u'chgPct7', u'bondPremRatio', u'debtPuredebtRatio', u'puredebtPremRatio', u'reviseItem', u'triggerItem', u'triggerCondItem']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','tickerBond': 'str','secShortNameBond': 'str','tickerEqu': 'str','secShortNameEqu': 'str','reviseItem': 'str','triggerItem': 'str','triggerCondItem': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktThemedGet(themeID = "", isIndustry = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取主题板块日度行情信息，包含主题的当日开、高、低、收价，成交量、成交金额、涨家数、涨停家数、领涨股等信息
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表,themeID、isIndustry至少选择一个
    :param isIndustry: 0--否；1--是,themeID、isIndustry至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktThemed.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    if not isinstance(isIndustry, str) and not isinstance(isIndustry, unicode):
        isIndustry = str(isIndustry)

    requestString.append("&isIndustry=%s"%(isIndustry))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktThemedGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktThemedGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'tradeDate', u'preClsoePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chgPct', u'ticker', u'upCount', u'downCount', u'uplimitCount', u'downlimitCount', u'turnoverRate', u'netInflow', u'netMainInflow', u'isIndustry']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktThemewGet(themeID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取主题板块周度行情信息，包含主题的周度开、高、低、收价，成交量、成交金额、资金流入额等信息
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表,themeID至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktThemew.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktThemewGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktThemewGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'endDate', u'preClsoePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'rangePct', u'netInflow', u'netMainInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktThememGet(themeID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取主题板块月度行情信息，包含主题的月度开、高、低、收价，成交量、成交金额、资金流入额等信息
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表,themeID至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktThemem.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktThememGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktThememGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'endDate', u'preClsoePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'rangePct', u'netInflow', u'netMainInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqudStatsGet(beginDate = "", endDate = "", statsTypeClass = "", field = "", pandas = "1"):
    """
    获取股票市场统计信息，包含沪市主板、深市主板、深市创业板、深市中小板成交量、成交金额、市值等汇总信息。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param statsTypeClass: 统计角度，包括“股票”、“A股”、“B股”、“中小板”、“创业板”。可多值输入，用英文半角,分隔。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqudStats.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&statsTypeClass=")
    if hasattr(statsTypeClass,'__iter__') and not isinstance(statsTypeClass, str):
        if len(statsTypeClass) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsTypeClass
            requestString.append(None)
        else:
            requestString.append(','.join(statsTypeClass))
    else:
        requestString.append(statsTypeClass)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqudStatsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqudStatsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'statsTypeClass', u'marketValue', u'negMarketValue', u'turnoverVol', u'turnoverValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'statsTypeClass': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktThemeMonthGet(themeID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取主题板块月度行情信息，包含主题的月度开、高、低、收价，成交量、成交金额、资金流入额等信息
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表,themeID至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktThemeMonth.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktThemeMonthGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktThemeMonthGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'endDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'rangePct', u'netInflow', u'netMainInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktThemeDayGet(themeID = "", tradeDate = "", isIndustry = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取主题板块日度行情信息，包含主题的当日开、高、低、收价，成交量、成交金额、涨家数、涨停家数、领涨股等信息
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表,themeID、tradeDate、isIndustry至少选择一个
    :param tradeDate: 交易日期，格式为YYYYMMDD,themeID、tradeDate、isIndustry至少选择一个
    :param isIndustry: 是否为行业主题，0--否；1--是,themeID、tradeDate、isIndustry至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktThemeDay.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(isIndustry, str) and not isinstance(isIndustry, unicode):
        isIndustry = str(isIndustry)

    requestString.append("&isIndustry=%s"%(isIndustry))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktThemeDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktThemeDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'tradeDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chgPct', u'ticker', u'upCount', u'downCount', u'uplimitCount', u'downlimitCount', u'turnoverRate', u'netInflow', u'netMainInflow', u'isIndustry', u'chgPct5', u'chgPct10', u'chgPct20', u'chgPctFY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktThemeWeekGet(themeID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取主题板块周度行情信息，包含主题的周度开、高、低、收价，成交量、成交金额、资金流入额等信息
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表,themeID至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktThemeWeek.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktThemeWeekGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktThemeWeekGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'endDate', u'preClosePrice', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chgPct', u'rangePct', u'netInflow', u'netMainInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxPerfGet(secID = "", ticker = "", tradeDate = "", progFullName = "", partyID = "", field = "", pandas = "1"):
    """
    获取指数每日最新表现，包含最近一个交易日的周、月、季、半年、年等区间涨跌幅情况。沪深重要指数的更新时间为15:30，其他指数因发布机构不同会陆续更新。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate、progFullName、partyID至少选择一个
    :param ticker: 指数通用代码,可以是列表,secID、ticker、tradeDate、progFullName、partyID至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate、progFullName、partyID至少选择一个
    :param progFullName: 发布机构全称，可模糊搜索。如中证指数有限公司，上海证券交易所等,secID、ticker、tradeDate、progFullName、partyID至少选择一个
    :param partyID: 通联编制的机构编码，可从DataAPI.PartyIDGet查找,可以是列表,secID、ticker、tradeDate、progFullName、partyID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxPerf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(progFullName, str) and not isinstance(progFullName, unicode):
        progFullName = str(progFullName)

    requestString.append("&progFullName=%s"%(progFullName))
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxPerfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxPerfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'progFullName', u'secShortName', u'exchangeCD', u'tradeDate', u'chgPct', u'chgPct1W', u'chgPctFW', u'chgPct1M', u'chgPctFM', u'chgPct3M', u'chgPctTM', u'chgPct6M', u'chgPctSM', u'chgPct1Y', u'chgPctFY', u'chgPctFL', u'amplitude', u'VR', u'updateTime', u'partyID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','progFullName': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqudEvalGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深股票每日估值信息，包含总市值、流通市值、市盈率、市净率、市现率、企业价值倍数等信息（含科创板）。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，只输入一个日期，可获取到对应日期全部沪深股票的估值信息,secID、ticker、tradeDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqudEval.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqudEvalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqudEvalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'marketValue', u'negMarketValue', u'PE', u'PE1', u'PE2', u'PB', u'PS', u'PS1', u'PCF', u'PCF1', u'PCF2', u'PCF3', u'EV', u'EVEBITDA', u'EVSales', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutPreGet(secID = "", ticker = "", contractObject = "", tradeDate = "", exchangeCD = "", contractMark = "", mainOI = "", mainVol = "", sMainOI = "", sMainVol = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取期货盘前信息，包含主力合约、连续合约、涨跌停限制、保证金率等。持仓量主力为前三个交易日平均持仓量最大的合约，且一月内不反复；成交量主力为前三个交易日平均成交量最大的合约，且一月内不反复。T-1日收盘后更新主力/连续标记，T-1日夜盘开始前更新商品期货的涨跌停价。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、contractObject、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、contractObject、tradeDate至少选择一个
    :param contractObject: 期货品种代码,可以是列表,secID、ticker、contractObject、tradeDate至少选择一个
    :param tradeDate: 交易日期，主力、涨跌停及保证金对应的生效日期,secID、ticker、contractObject、tradeDate至少选择一个
    :param exchangeCD: 通联编制的交易市场编码,可空
    :param contractMark: 连续合约标志，如当月连续L0在每个交易日只对应一个月合约。配合contractObject使用，可提取连续合约全量历史。商品期货：L0-L4；股指期货：L0/L1/L3/L6；国债期货：L3/L6/L9。,可空
    :param mainOI: 是否持仓主力，1-是；0-否。配合contractObject使用，可提取主力全量历史。持仓量判断主力：前三个交易日平均持仓量最大的合约，且一个月内不反复，最后交易日不做为主力。,可空
    :param mainVol: 是否成交主力，1-是；0-否。成交量判断主力：前三个交易日平均成交量最大的合约，且一个月内不反复，最后交易日不做为主力。,可空
    :param sMainOI: 是否持仓次主力，1-是；0-否。配合contractObject使用，可提取主力全量历史。持仓量判断主力：前三个交易日平均持仓量最大的合约，且一个月内不反复，最后交易日不做为主力。,可空
    :param sMainVol: 是否成交次主力，1-是；0-否。成交量判断主力：前三个交易日平均成交量最大的合约，且一个月内不反复，最后交易日不做为主力。,可空
    :param beginDate: 查询tradeDate起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询tradeDate截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktFutPre.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&contractObject=")
    if hasattr(contractObject,'__iter__') and not isinstance(contractObject, str):
        if len(contractObject) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractObject
            requestString.append(None)
        else:
            requestString.append(','.join(contractObject))
    else:
        requestString.append(contractObject)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    if not isinstance(contractMark, str) and not isinstance(contractMark, unicode):
        contractMark = str(contractMark)

    requestString.append("&contractMark=%s"%(contractMark))
    if not isinstance(mainOI, str) and not isinstance(mainOI, unicode):
        mainOI = str(mainOI)

    requestString.append("&mainOI=%s"%(mainOI))
    if not isinstance(mainVol, str) and not isinstance(mainVol, unicode):
        mainVol = str(mainVol)

    requestString.append("&mainVol=%s"%(mainVol))
    if not isinstance(sMainOI, str) and not isinstance(sMainOI, unicode):
        sMainOI = str(sMainOI)

    requestString.append("&sMainOI=%s"%(sMainOI))
    if not isinstance(sMainVol, str) and not isinstance(sMainVol, unicode):
        sMainVol = str(sMainVol)

    requestString.append("&sMainVol=%s"%(sMainVol))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutPreGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutPreGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'contractObject', u'exchangeCD', u'contractMonth', u'tradeDate', u'contractMark', u'mainOI', u'mainVol', u'sMainOI', u'sMainVol', u'limitUpPrice', u'limitDownPrice', u'tradeMarginRatio', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','contractObject': 'str','exchangeCD': 'str','contractMonth': 'str','contractMark': 'str','mainOI': 'str','mainVol': 'str','sMainOI': 'str','sMainVol': 'str','tradeMarginRatio': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktStockFactorsOneDayProGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取多只股票历史上某一天的因子数据（专业版）。股票因子分三个时间段生产，分别是T日17点00分、T日21点30分和T+1日04点00分生产完成。如果调用的因子中包含还未生产完成的因子会导致所有因子都不会返回。具体每个因子的生产时间在文档中有标注，请在调用因子时确认清楚。
    
    :param tradeDate: 日期
    :param secID: 多只股票ID，用逗号隔开,可以是列表,可空
    :param ticker: 多只股票交易代码，用逗号隔开,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktStockFactorsOneDayPro.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktStockFactorsOneDayProGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktStockFactorsOneDayProGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'AccountsPayablesTDays', u'AccountsPayablesTRate', u'AdminiExpenseRate', u'ARTDays', u'ARTRate', u'ASSI', u'BLEV', u'BondsPayableToAsset', u'CashRateOfSales', u'CashToCurrentLiability', u'CMRA', u'CTOP', u'CTP5', u'CurrentAssetsRatio', u'CurrentAssetsTRate', u'CurrentRatio', u'DAVOL10', u'DAVOL20', u'DAVOL5', u'DDNBT', u'DDNCR', u'DDNSR', u'DebtEquityRatio', u'DebtsAssetRatio', u'DHILO', u'DilutedEPS', u'DVRAT', u'EBITToTOR', u'EGRO', u'EMA10', u'EMA120', u'EMA20', u'EMA5', u'EMA60', u'EPS', u'EquityFixedAssetRatio', u'EquityToAsset', u'EquityTRate', u'ETOP', u'ETP5', u'FinancialExpenseRate', u'FinancingCashGrowRate', u'FixAssetRatio', u'FixedAssetsTRate', u'GrossIncomeRatio', u'HBETA', u'HSIGMA', u'IntangibleAssetRatio', u'InventoryTDays', u'InventoryTRate', u'InvestCashGrowRate', u'LCAP', u'LFLO', u'LongDebtToAsset', u'LongDebtToWorkingCapital', u'LongTermDebtToAsset', u'MA10', u'MA120', u'MA20', u'MA5', u'MA60', u'MAWVAD', u'MFI', u'MLEV', u'NetAssetGrowRate', u'NetProfitGrowRate', u'NetProfitRatio', u'NOCFToOperatingNI', u'NonCurrentAssetsRatio', u'NPParentCompanyGrowRate', u'NPToTOR', u'OperatingExpenseRate', u'OperatingProfitGrowRate', u'OperatingProfitRatio', u'OperatingProfitToTOR', u'OperatingRevenueGrowRate', u'OperCashGrowRate', u'OperCashInToCurrentLiability', u'PB', u'PCF', u'PE', u'PS', u'PSY', u'QuickRatio', u'REVS10', u'REVS20', u'REVS5', u'ROA', u'ROA5', u'ROE', u'ROE5', u'RSI', u'RSTR12', u'RSTR24', u'SalesCostRatio', u'SaleServiceCashToOR', u'SUE', u'TaxRatio', u'TOBT', u'TotalAssetGrowRate', u'TotalAssetsTRate', u'TotalProfitCostRatio', u'TotalProfitGrowRate', u'VOL10', u'VOL120', u'VOL20', u'VOL240', u'VOL5', u'VOL60', u'WVAD', u'REC', u'DAREC', u'GREC', u'FY12P', u'DAREV', u'GREV', u'SFY12P', u'DASREV', u'GSREV', u'FEARNG', u'FSALESG', u'TA2EV', u'CFO2EV', u'ACCA', u'DEGM', u'SUOI', u'EARNMOM', u'FiftyTwoWeekHigh', u'Volatility', u'Skewness', u'ILLIQUIDITY', u'BackwardADJ', u'MACD', u'ADTM', u'ATR14', u'ATR6', u'BIAS10', u'BIAS20', u'BIAS5', u'BIAS60', u'BollDown', u'BollUp', u'CCI10', u'CCI20', u'CCI5', u'CCI88', u'KDJ_K', u'KDJ_D', u'KDJ_J', u'ROC6', u'ROC20', u'SBM', u'STM', u'UpRVI', u'DownRVI', u'RVI', u'SRMI', u'ChandeSD', u'ChandeSU', u'CMO', u'DBCD', u'ARC', u'OBV', u'OBV6', u'OBV20', u'TVMA20', u'TVMA6', u'TVSTD20', u'TVSTD6', u'VDEA', u'VDIFF', u'VEMA10', u'VEMA12', u'VEMA26', u'VEMA5', u'VMACD', u'VOSC', u'VR', u'VROC12', u'VROC6', u'VSTD10', u'VSTD20', u'KlingerOscillator', u'MoneyFlow20', u'AD', u'AD20', u'AD6', u'CoppockCurve', u'ASI', u'ChaikinOscillator', u'ChaikinVolatility', u'EMV14', u'EMV6', u'plusDI', u'minusDI', u'ADX', u'ADXR', u'Aroon', u'AroonDown', u'AroonUp', u'DEA', u'DIFF', u'DDI', u'DIZ', u'DIF', u'MTM', u'MTMMA', u'PVT', u'PVT6', u'PVT12', u'TRIX5', u'TRIX10', u'UOS', u'MA10RegressCoeff12', u'MA10RegressCoeff6', u'PLRC6', u'PLRC12', u'SwingIndex', u'Ulcer10', u'Ulcer5', u'Hurst', u'ACD6', u'ACD20', u'EMA12', u'EMA26', u'APBMA', u'BBI', u'BBIC', u'TEMA10', u'TEMA5', u'MA10Close', u'AR', u'BR', u'ARBR', u'CR20', u'MassIndex', u'BearPower', u'BullPower', u'Elder', u'NVI', u'PVI', u'RC12', u'RC24', u'JDQS20', u'Variance20', u'Variance60', u'Variance120', u'Kurtosis20', u'Kurtosis60', u'Kurtosis120', u'Alpha20', u'Alpha60', u'Alpha120', u'Beta20', u'Beta60', u'Beta120', u'SharpeRatio20', u'SharpeRatio60', u'SharpeRatio120', u'TreynorRatio20', u'TreynorRatio60', u'TreynorRatio120', u'InformationRatio20', u'InformationRatio60', u'InformationRatio120', u'GainVariance20', u'GainVariance60', u'GainVariance120', u'LossVariance20', u'LossVariance60', u'LossVariance120', u'GainLossVarianceRatio20', u'GainLossVarianceRatio60', u'GainLossVarianceRatio120', u'RealizedVolatility', u'REVS60', u'REVS120', u'REVS250', u'REVS750', u'REVS5m20', u'REVS5m60', u'REVS5Indu1', u'REVS20Indu1', u'Volumn1M', u'Volumn3M', u'Price1M', u'Price3M', u'Price1Y', u'Rank1M', u'CashDividendCover', u'DividendCover', u'DividendPaidRatio', u'RetainedEarningRatio', u'CashEquivalentPS', u'DividendPS', u'EPSTTM', u'NetAssetPS', u'TORPS', u'TORPSLatest', u'OperatingRevenuePS', u'OperatingRevenuePSLatest', u'OperatingProfitPS', u'OperatingProfitPSLatest', u'CapitalSurplusFundPS', u'SurplusReserveFundPS', u'UndividedProfitPS', u'RetainedEarningsPS', u'OperCashFlowPS', u'CashFlowPS', u'NetNonOIToTP', u'NetNonOIToTPLatest', u'PeriodCostsRate', u'InterestCover', u'NetProfitGrowRate3Y', u'NetProfitGrowRate5Y', u'OperatingRevenueGrowRate3Y', u'OperatingRevenueGrowRate5Y', u'NetCashFlowGrowRate', u'NetProfitCashCover', u'OperCashInToAsset', u'CashConversionCycle', u'OperatingCycle', u'PEG3Y', u'PEG5Y', u'PEIndu', u'PBIndu', u'PSIndu', u'PCFIndu', u'PEHist20', u'PEHist60', u'PEHist120', u'PEHist250', u'StaticPE', u'ForwardPE', u'EnterpriseFCFPS', u'ShareholderFCFPS', u'ROEDiluted', u'ROEAvg', u'ROEWeighted', u'ROECut', u'ROECutWeighted', u'ROIC', u'ROAEBIT', u'ROAEBITTTM', u'OperatingNIToTP', u'OperatingNIToTPLatest', u'InvestRAssociatesToTP', u'InvestRAssociatesToTPLatest', u'NPCutToNP', u'SuperQuickRatio', u'TSEPToInterestBearDebt', u'DebtTangibleEquityRatio', u'TangibleAToInteBearDebt', u'TangibleAToNetDebt', u'NOCFToTLiability', u'NOCFToInterestBearDebt', u'NOCFToNetDebt', u'TSEPToTotalCapital', u'InteBearDebtToTotalCapital', u'NPParentCompanyCutYOY', u'SalesServiceCashToORLatest', u'CashRateOfSalesLatest', u'NOCFToOperatingNILatest', u'TotalAssets', u'MktValue', u'NegMktValue', u'TEAP', u'NIAP', u'TotalFixedAssets', u'IntFreeCL', u'IntFreeNCL', u'IntCL', u'IntDebt', u'NetDebt', u'NetTangibleAssets', u'WorkingCapital', u'NetWorkingCapital', u'TotalPaidinCapital', u'RetainedEarnings', u'OperateNetIncome', u'ValueChgProfit', u'NetIntExpense', u'EBIT', u'EBITDA', u'EBIAT', u'NRProfitLoss', u'NIAPCut', u'FCFF', u'FCFE', u'DA', u'TRevenueTTM', u'TCostTTM', u'RevenueTTM', u'CostTTM', u'GrossProfitTTM', u'SalesExpenseTTM', u'AdminExpenseTTM', u'FinanExpenseTTM', u'AssetImpairLossTTM', u'NPFromOperatingTTM', u'NPFromValueChgTTM', u'OperateProfitTTM', u'NonOperatingNPTTM', u'TProfitTTM', u'NetProfitTTM', u'NetProfitAPTTM', u'SaleServiceRenderCashTTM', u'NetOperateCFTTM', u'NetInvestCFTTM', u'NetFinanceCFTTM', u'GrossProfit', u'Beta252', u'RSTR504', u'EPIBS', u'CETOP', u'DASTD', u'CmraCNE5', u'HsigmaCNE5', u'SGRO', u'EgibsLong', u'STOM', u'STOQ', u'STOA', u'NLSIZE']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktStockFactorsDateRangeProGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取一只股票历史上某一时间段的因子数据（专业版）。股票因子分三个时间段生产，分别是T日17点00分、T日21点30分和T+1日04点00分生产完成。如果调用的因子中包含还未生产完成的因子会导致所有因子都不会返回。具体每个因子的生产时间在文档中有标注，请在调用因子时确认清楚。
    
    :param secID: 一只股票ID,secID、ticker至少选择一个
    :param ticker: 一只股票交易代码,secID、ticker至少选择一个
    :param beginDate: 开始日期,可空
    :param endDate: 结束日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktStockFactorsDateRangePro.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktStockFactorsDateRangeProGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktStockFactorsDateRangeProGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'AccountsPayablesTDays', u'AccountsPayablesTRate', u'AdminiExpenseRate', u'ARTDays', u'ARTRate', u'ASSI', u'BLEV', u'BondsPayableToAsset', u'CashRateOfSales', u'CashToCurrentLiability', u'CMRA', u'CTOP', u'CTP5', u'CurrentAssetsRatio', u'CurrentAssetsTRate', u'CurrentRatio', u'DAVOL10', u'DAVOL20', u'DAVOL5', u'DDNBT', u'DDNCR', u'DDNSR', u'DebtEquityRatio', u'DebtsAssetRatio', u'DHILO', u'DilutedEPS', u'DVRAT', u'EBITToTOR', u'EGRO', u'EMA10', u'EMA120', u'EMA20', u'EMA5', u'EMA60', u'EPS', u'EquityFixedAssetRatio', u'EquityToAsset', u'EquityTRate', u'ETOP', u'ETP5', u'FinancialExpenseRate', u'FinancingCashGrowRate', u'FixAssetRatio', u'FixedAssetsTRate', u'GrossIncomeRatio', u'HBETA', u'HSIGMA', u'IntangibleAssetRatio', u'InventoryTDays', u'InventoryTRate', u'InvestCashGrowRate', u'LCAP', u'LFLO', u'LongDebtToAsset', u'LongDebtToWorkingCapital', u'LongTermDebtToAsset', u'MA10', u'MA120', u'MA20', u'MA5', u'MA60', u'MAWVAD', u'MFI', u'MLEV', u'NetAssetGrowRate', u'NetProfitGrowRate', u'NetProfitRatio', u'NOCFToOperatingNI', u'NonCurrentAssetsRatio', u'NPParentCompanyGrowRate', u'NPToTOR', u'OperatingExpenseRate', u'OperatingProfitGrowRate', u'OperatingProfitRatio', u'OperatingProfitToTOR', u'OperatingRevenueGrowRate', u'OperCashGrowRate', u'OperCashInToCurrentLiability', u'PB', u'PCF', u'PE', u'PS', u'PSY', u'QuickRatio', u'REVS10', u'REVS20', u'REVS5', u'ROA', u'ROA5', u'ROE', u'ROE5', u'RSI', u'RSTR12', u'RSTR24', u'SalesCostRatio', u'SaleServiceCashToOR', u'SUE', u'TaxRatio', u'TOBT', u'TotalAssetGrowRate', u'TotalAssetsTRate', u'TotalProfitCostRatio', u'TotalProfitGrowRate', u'VOL10', u'VOL120', u'VOL20', u'VOL240', u'VOL5', u'VOL60', u'WVAD', u'REC', u'DAREC', u'GREC', u'FY12P', u'DAREV', u'GREV', u'SFY12P', u'DASREV', u'GSREV', u'FEARNG', u'FSALESG', u'TA2EV', u'CFO2EV', u'ACCA', u'DEGM', u'SUOI', u'EARNMOM', u'FiftyTwoWeekHigh', u'Volatility', u'Skewness', u'ILLIQUIDITY', u'BackwardADJ', u'MACD', u'ADTM', u'ATR14', u'ATR6', u'BIAS10', u'BIAS20', u'BIAS5', u'BIAS60', u'BollDown', u'BollUp', u'CCI10', u'CCI20', u'CCI5', u'CCI88', u'KDJ_K', u'KDJ_D', u'KDJ_J', u'ROC6', u'ROC20', u'SBM', u'STM', u'UpRVI', u'DownRVI', u'RVI', u'SRMI', u'ChandeSD', u'ChandeSU', u'CMO', u'DBCD', u'ARC', u'OBV', u'OBV6', u'OBV20', u'TVMA20', u'TVMA6', u'TVSTD20', u'TVSTD6', u'VDEA', u'VDIFF', u'VEMA10', u'VEMA12', u'VEMA26', u'VEMA5', u'VMACD', u'VOSC', u'VR', u'VROC12', u'VROC6', u'VSTD10', u'VSTD20', u'KlingerOscillator', u'MoneyFlow20', u'AD', u'AD20', u'AD6', u'CoppockCurve', u'ASI', u'ChaikinOscillator', u'ChaikinVolatility', u'EMV14', u'EMV6', u'plusDI', u'minusDI', u'ADX', u'ADXR', u'Aroon', u'AroonDown', u'AroonUp', u'DEA', u'DIFF', u'DDI', u'DIZ', u'DIF', u'MTM', u'MTMMA', u'PVT', u'PVT6', u'PVT12', u'TRIX5', u'TRIX10', u'UOS', u'MA10RegressCoeff12', u'MA10RegressCoeff6', u'PLRC6', u'PLRC12', u'SwingIndex', u'Ulcer10', u'Ulcer5', u'Hurst', u'ACD6', u'ACD20', u'EMA12', u'EMA26', u'APBMA', u'BBI', u'BBIC', u'TEMA10', u'TEMA5', u'MA10Close', u'AR', u'BR', u'ARBR', u'CR20', u'MassIndex', u'BearPower', u'BullPower', u'Elder', u'NVI', u'PVI', u'RC12', u'RC24', u'JDQS20', u'Variance20', u'Variance60', u'Variance120', u'Kurtosis20', u'Kurtosis60', u'Kurtosis120', u'Alpha20', u'Alpha60', u'Alpha120', u'Beta20', u'Beta60', u'Beta120', u'SharpeRatio20', u'SharpeRatio60', u'SharpeRatio120', u'TreynorRatio20', u'TreynorRatio60', u'TreynorRatio120', u'InformationRatio20', u'InformationRatio60', u'InformationRatio120', u'GainVariance20', u'GainVariance60', u'GainVariance120', u'LossVariance20', u'LossVariance60', u'LossVariance120', u'GainLossVarianceRatio20', u'GainLossVarianceRatio60', u'GainLossVarianceRatio120', u'RealizedVolatility', u'REVS60', u'REVS120', u'REVS250', u'REVS750', u'REVS5m20', u'REVS5m60', u'REVS5Indu1', u'REVS20Indu1', u'Volumn1M', u'Volumn3M', u'Price1M', u'Price3M', u'Price1Y', u'Rank1M', u'CashDividendCover', u'DividendCover', u'DividendPaidRatio', u'RetainedEarningRatio', u'CashEquivalentPS', u'DividendPS', u'EPSTTM', u'NetAssetPS', u'TORPS', u'TORPSLatest', u'OperatingRevenuePS', u'OperatingRevenuePSLatest', u'OperatingProfitPS', u'OperatingProfitPSLatest', u'CapitalSurplusFundPS', u'SurplusReserveFundPS', u'UndividedProfitPS', u'RetainedEarningsPS', u'OperCashFlowPS', u'CashFlowPS', u'NetNonOIToTP', u'NetNonOIToTPLatest', u'PeriodCostsRate', u'InterestCover', u'NetProfitGrowRate3Y', u'NetProfitGrowRate5Y', u'OperatingRevenueGrowRate3Y', u'OperatingRevenueGrowRate5Y', u'NetCashFlowGrowRate', u'NetProfitCashCover', u'OperCashInToAsset', u'CashConversionCycle', u'OperatingCycle', u'PEG3Y', u'PEG5Y', u'PEIndu', u'PBIndu', u'PSIndu', u'PCFIndu', u'PEHist20', u'PEHist60', u'PEHist120', u'PEHist250', u'StaticPE', u'ForwardPE', u'EnterpriseFCFPS', u'ShareholderFCFPS', u'ROEDiluted', u'ROEAvg', u'ROEWeighted', u'ROECut', u'ROECutWeighted', u'ROIC', u'ROAEBIT', u'ROAEBITTTM', u'OperatingNIToTP', u'OperatingNIToTPLatest', u'InvestRAssociatesToTP', u'InvestRAssociatesToTPLatest', u'NPCutToNP', u'SuperQuickRatio', u'TSEPToInterestBearDebt', u'DebtTangibleEquityRatio', u'TangibleAToInteBearDebt', u'TangibleAToNetDebt', u'NOCFToTLiability', u'NOCFToInterestBearDebt', u'NOCFToNetDebt', u'TSEPToTotalCapital', u'InteBearDebtToTotalCapital', u'NPParentCompanyCutYOY', u'SalesServiceCashToORLatest', u'CashRateOfSalesLatest', u'NOCFToOperatingNILatest', u'TotalAssets', u'MktValue', u'NegMktValue', u'TEAP', u'NIAP', u'TotalFixedAssets', u'IntFreeCL', u'IntFreeNCL', u'IntCL', u'IntDebt', u'NetDebt', u'NetTangibleAssets', u'WorkingCapital', u'NetWorkingCapital', u'TotalPaidinCapital', u'RetainedEarnings', u'OperateNetIncome', u'ValueChgProfit', u'NetIntExpense', u'EBIT', u'EBITDA', u'EBIAT', u'NRProfitLoss', u'NIAPCut', u'FCFF', u'FCFE', u'DA', u'TRevenueTTM', u'TCostTTM', u'RevenueTTM', u'CostTTM', u'GrossProfitTTM', u'SalesExpenseTTM', u'AdminExpenseTTM', u'FinanExpenseTTM', u'AssetImpairLossTTM', u'NPFromOperatingTTM', u'NPFromValueChgTTM', u'OperateProfitTTM', u'NonOperatingNPTTM', u'TProfitTTM', u'NetProfitTTM', u'NetProfitAPTTM', u'SaleServiceRenderCashTTM', u'NetOperateCFTTM', u'NetInvestCFTTM', u'NetFinanceCFTTM', u'GrossProfit', u'Beta252', u'RSTR504', u'EPIBS', u'CETOP', u'DASTD', u'CmraCNE5', u'HsigmaCNE5', u'SGRO', u'EgibsLong', u'STOM', u'STOQ', u'STOA', u'NLSIZE']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktCryptoCurrdGet(secID = "", currencyPair = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取数字货币现货日行情信息，包含开盘价、最高价、最低价、收盘价、成交量等，T+1日更新。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、currencyPair、beginDate、endDate、exchangeCD至少选择一个
    :param currencyPair: 货币对通用交易代码，特殊字符需转义，如'|'需转换为'%7c',可以是列表,secID、currencyPair、beginDate、endDate、exchangeCD至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、currencyPair、beginDate、endDate、exchangeCD至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、currencyPair、beginDate、endDate、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的交易市场编码,secID、currencyPair、beginDate、endDate、exchangeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktCryptoCurrd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktCryptoCurrdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktCryptoCurrdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'currencyPair', u'exchangeCD', u'tradeDate', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'turnoverVol']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','currencyPair': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktCryptoFutdGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取数字货币期货日行情信息，包含前结算价、开盘价、最高价、最低价、收盘价、结算价等。注：CBOE已于2019年06月停止比特币期货交易。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 通用交易代码,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktCryptoFutd.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktCryptoFutdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktCryptoFutdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'preSettlePrice', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'settlePrice', u'turnoverVol', u'turnoverValue', u'chg', u'chg1', u'efp', u'openInt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','efp': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def StockFctIndicOneDayGet(tradeDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取多只股票历史上某一天的指标数据
    
    :param tradeDate: 日期
    :param secID: 多只股票ID，用逗号隔开,可以是列表,可空
    :param ticker: 多只股票交易代码，用逗号隔开,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getStockFctIndicOneDay.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'StockFctIndicOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'StockFctIndicOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'EBITPS', u'RESERPS', u'dividendPS', u'invCFNetInc', u'finCFNetInc', u'finCFps', u'invCFps', u'revenueC3', u'revenueC5', u'netProfitC3', u'netProfitC5', u'roe5', u'CEps', u'TAps', u'chgPct', u'totalShares', u'nonrestFloat', u'dealAmount', u'priceAmp', u'daysOnMkt', u'tradeDays', u'inflowT', u'outflowT', u'netInflowT', u'inflowS', u'inflowM', u'inflowL', u'inflowXl', u'outflowS', u'outflowM', u'outflowL', u'outflowXl', u'netInflowS', u'netInflowS5', u'netInflowS20', u'netInflowM', u'netInflowM5', u'netInflowM20', u'netInflowL', u'netInflowL5', u'netInflowL20', u'netInflowXl', u'netInflowXl5', u'netInflowXl20', u'upLimitTimes', u'upLimitOpen', u'upLimitDay', u'udLimitTimes', u'dnLimitTimes', u'dnLimitOpen', u'dnLimitDay', u'top5NetIn', u'top5NetOut', u'tWorth', u'tROE', u'tProfit', u'tPrice', u'tPE', u'tMobility', u'tMVStyle', u'tLeverage', u'tHbeta', u'tGrowth', u'bulkFundNum', u'bulkFundPct', u'bollUpBreak', u'bollDnBreak', u'rsiGoldCross', u'rsiDeathCross', u'rsiTopDiver', u'rsiBtmDiver', u'rsiShort', u'rsiLong', u'volGoldCross', u'volDeathCross', u'volLong', u'volShort', u'maLong', u'maShort', u'maDeathCross', u'maGoldCross', u'emaLong', u'emaShort', u'emaGoldCross', u'emaDeathCross', u'macdLong', u'macdShort', u'macdTopDiver', u'macdBtmDiver', u'macdGoldCross', u'macdDeathCross', u'macdTopDiverW', u'macdBtmDiverW', u'macdGoldCrossW', u'macdDeathCrossW', u'mfiOB', u'mfiOS', u'crOB', u'crOS', u'cciOB', u'cciOS', u'kdjLong', u'kdjShort', u'kdjLGoldCross', u'kdjHDeathCross', u'kdjBtmDiver', u'kdjTopDiver', u'volatility20', u'volatility60', u'volatility120', u'boldHead', u'boldBottom', u'longUpShadow', u'midUpShadow', u'longLowShadow', u'midLowShadow', u'openLow', u'jumpOpenLow', u'sunK', u'microSun', u'shortSun', u'midSun', u'longSun', u'lunarK', u'microLunar', u'shortLunar', u'midLunar', u'longLunar', u'longT', u'revLongT', u'oneFlag', u'cross', u'shootStar', u'crossDying', u'longCross', u'bearishEngulf', u'shrinkVol', u'enlargeVol', u'above20High', u'above60High', u'below20Low', u'below60Low', u'openHigh', u'multiLongMark', u'jumpOpenHigh', u'mgrHIncNum', u'mgrHIncAmt', u'mgrHIncTimes', u'mgrHIncPct', u'mgrHIncNum5', u'mgrHIncAmt5', u'mgrHIncTimes5', u'mgrHIncPct5', u'mgrHIncNum20', u'mgrHIncAmt20', u'mgrHIncTimes20', u'mgrHIncPct20', u'rFloatNum', u'rFloatPct', u'rFloatNum20', u'rFloatPct20', u'rFloatNum60', u'rFloatPct60', u'accuPFloor', u'accuPCeil', u'preAccuPFloor', u'preAccuPCeil', u'preDays', u'preSTIn', u'preSTSpd', u'punishMark', u'holderNum', u'avgHoldings', u'holderChgPct60', u'instHoldPct', u'instHoldLrr', u'stateHoldPct', u'stateHoldLrr', u'socialHoldPct', u'socialHoldLrr', u'top10HoldPct', u'top10HoldLrr']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def StockFctIndicDateRangeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取一只股票历史上某一段时间的指标数据
    
    :param secID: 多只股票ID，用逗号隔开,可以是列表,secID、ticker至少选择一个
    :param ticker: 多只股票交易代码，用逗号隔开,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期,可空
    :param endDate: 截止日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getStockFctIndicDateRange.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'StockFctIndicDateRangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'StockFctIndicDateRangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'EBITPS', u'RESERPS', u'dividendPS', u'invCFNetInc', u'finCFNetInc', u'finCFps', u'invCFps', u'revenueC3', u'revenueC5', u'netProfitC3', u'netProfitC5', u'roe5', u'CEps', u'TAps', u'chgPct', u'totalShares', u'nonrestFloat', u'dealAmount', u'priceAmp', u'daysOnMkt', u'tradeDays', u'inflowT', u'outflowT', u'netInflowT', u'inflowS', u'inflowM', u'inflowL', u'inflowXl', u'outflowS', u'outflowM', u'outflowL', u'outflowXl', u'netInflowS', u'netInflowS5', u'netInflowS20', u'netInflowM', u'netInflowM5', u'netInflowM20', u'netInflowL', u'netInflowL5', u'netInflowL20', u'netInflowXl', u'netInflowXl5', u'netInflowXl20', u'upLimitTimes', u'upLimitOpen', u'upLimitDay', u'udLimitTimes', u'dnLimitTimes', u'dnLimitOpen', u'dnLimitDay', u'top5NetIn', u'top5NetOut', u'tWorth', u'tROE', u'tProfit', u'tPrice', u'tPE', u'tMobility', u'tMVStyle', u'tLeverage', u'tHbeta', u'tGrowth', u'bulkFundNum', u'bulkFundPct', u'bollUpBreak', u'bollDnBreak', u'rsiGoldCross', u'rsiDeathCross', u'rsiTopDiver', u'rsiBtmDiver', u'rsiShort', u'rsiLong', u'volGoldCross', u'volDeathCross', u'volLong', u'volShort', u'maLong', u'maShort', u'maDeathCross', u'maGoldCross', u'emaLong', u'emaShort', u'emaGoldCross', u'emaDeathCross', u'macdLong', u'macdShort', u'macdTopDiver', u'macdBtmDiver', u'macdGoldCross', u'macdDeathCross', u'macdTopDiverW', u'macdBtmDiverW', u'macdGoldCrossW', u'macdDeathCrossW', u'mfiOB', u'mfiOS', u'crOB', u'crOS', u'cciOB', u'cciOS', u'kdjLong', u'kdjShort', u'kdjLGoldCross', u'kdjHDeathCross', u'kdjBtmDiver', u'kdjTopDiver', u'volatility20', u'volatility60', u'volatility120', u'boldHead', u'boldBottom', u'longUpShadow', u'midUpShadow', u'longLowShadow', u'midLowShadow', u'openLow', u'jumpOpenLow', u'sunK', u'microSun', u'shortSun', u'midSun', u'longSun', u'lunarK', u'microLunar', u'shortLunar', u'midLunar', u'longLunar', u'longT', u'revLongT', u'oneFlag', u'cross', u'shootStar', u'crossDying', u'longCross', u'bearishEngulf', u'shrinkVol', u'enlargeVol', u'above20High', u'above60High', u'below20Low', u'below60Low', u'openHigh', u'multiLongMark', u'jumpOpenHigh', u'mgrHIncNum', u'mgrHIncAmt', u'mgrHIncTimes', u'mgrHIncPct', u'mgrHIncNum5', u'mgrHIncAmt5', u'mgrHIncTimes5', u'mgrHIncPct5', u'mgrHIncNum20', u'mgrHIncAmt20', u'mgrHIncTimes20', u'mgrHIncPct20', u'rFloatNum', u'rFloatPct', u'rFloatNum20', u'rFloatPct20', u'rFloatNum60', u'rFloatPct60', u'accuPFloor', u'accuPCeil', u'preAccuPFloor', u'preAccuPCeil', u'preDays', u'preSTIn', u'preSTSpd', u'punishMark', u'holderNum', u'avgHoldings', u'holderChgPct60', u'instHoldPct', u'instHoldLrr', u'stateHoldPct', u'stateHoldLrr', u'socialHoldPct', u'socialHoldLrr', u'top10HoldPct', u'top10HoldLrr']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIdxMfGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取指数日度资金流向，提供大小单类明细，包含资金净流入、资金流入、资金流出、小单资金流入、小单资金流出、小单资金净流入等，其中单类大小定义为：（单位：元）N：0；S：(0，100万]；M：(100万，500万]；L：(500万，1000万]；XL：1000万以上。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 指数通用代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、tradeDate至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIdxMf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIdxMfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIdxMfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeDate', u'netInflow', u'netInflowS', u'netInflowM', u'netInflowL', u'netInflowXl', u'inflow', u'inflowS', u'inflowM', u'inflowL', u'inflowXl', u'outflow', u'outflowS', u'outflowM', u'outflowL', u'outflowXl', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktEqunMfGet(secID = "", ticker = "", statsFreq = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取近N个交易日的沪深股票资金流向统计数据，包括统计周期，净流入，净流入占比，主力净流入，主力净流入占比，资金流入，资金流出，及小/中/大/超大单类明细等（含科创板）。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、statsFreq、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、statsFreq、tradeDate至少选择一个
    :param statsFreq: 统计周期，交易所近N个交易日，提供三个维度：5、10、20,可以是列表,secID、ticker、statsFreq、tradeDate至少选择一个
    :param tradeDate: 交易日期,secID、ticker、statsFreq、tradeDate至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktEqunMf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&statsFreq=")
    if hasattr(statsFreq,'__iter__') and not isinstance(statsFreq, str):
        if len(statsFreq) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsFreq
            requestString.append(None)
        else:
            requestString.append(','.join(statsFreq))
    else:
        requestString.append(statsFreq)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktEqunMfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktEqunMfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'statsFreq', u'netInflow', u'netRate', u'mainInflow', u'mainRate', u'netInS', u'netRateS', u'netInM', u'netRateM', u'netInL', u'netRateL', u'netInXL', u'netRateXL', u'inflow', u'inflowS', u'inflowM', u'inflowL', u'inflowXL', u'outflow', u'outflowS', u'outflowM', u'outflowL', u'outflowXL', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','statsFreq': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktIndnMfGet(industryID = "", industrySymbol = "", statsFreq = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取一二三级申万行业在不同周期内的资金流向统计数据，包括统计周期，净流入，净流入占比，主力净流入，主力净流入占比，资金流入，资金流出，及各单类明细等。
    
    :param industryID: 通联编制的行业编码，如010303010101。可以使用getIndustry接口获取所有最新industryID，申万一二三级行业分类，industryVersionCD=010303，industryLevel=3，isNew=1。,可以是列表,industryID、industrySymbol、statsFreq、tradeDate至少选择一个
    :param industrySymbol: 申万行业代码，如110101。可以使用getIndustry接口获取所有最新industrySymbol，申万一二三级行业分类，industryVersionCD=010303，industryLevel=3，isNew=1。,可以是列表,industryID、industrySymbol、statsFreq、tradeDate至少选择一个
    :param statsFreq: 统计周期，交易所近N个交易日，目前提供5、10、20三种周期,可以是列表,industryID、industrySymbol、statsFreq、tradeDate至少选择一个
    :param tradeDate: 交易日期,industryID、industrySymbol、statsFreq、tradeDate至少选择一个
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getMktIndnMf.csv?ispandas=1&') 
    requestString.append("industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    requestString.append("&industrySymbol=")
    if hasattr(industrySymbol,'__iter__') and not isinstance(industrySymbol, str):
        if len(industrySymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industrySymbol
            requestString.append(None)
        else:
            requestString.append(','.join(industrySymbol))
    else:
        requestString.append(industrySymbol)
    requestString.append("&statsFreq=")
    if hasattr(statsFreq,'__iter__') and not isinstance(statsFreq, str):
        if len(statsFreq) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsFreq
            requestString.append(None)
        else:
            requestString.append(','.join(statsFreq))
    else:
        requestString.append(statsFreq)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktIndnMfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktIndnMfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'industryID', u'industrySymbol', u'industryName', u'tradeDate', u'statsFreq', u'netInflow', u'netRate', u'mainInflow', u'mainRate', u'netInS', u'netRateS', u'netInM', u'netRateM', u'netInL', u'netRateL', u'netInXL', u'netRateXL', u'inflow', u'inflowS', u'inflowM', u'inflowL', u'inflowXL', u'outflow', u'outflowS', u'outflowM', u'outflowL', u'outflowXL', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industryID': 'str','industrySymbol': 'str','industryName': 'str','statsFreq': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtISLatelyGet(field = "", pandas = "1"):
    """
    1、可获取上市公司最近一次数据，根据2007年新会计准则制定的合并利润表模板，仅收集合并报表数据；2、本表中单位为人民币元；4、每季更新（含科创板）。
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISLately.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtISLatelyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtISLatelyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'totalShares']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtMainIndiGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", field = "", pandas = "1"):
    """
    A股上市公司披露的主要财务指标及数据
    
    :param ticker: 股票交易代码，如'600000',可以是列表,ticker、secID至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600000.XSHG',可以是列表,ticker、secID至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtMainIndi.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtMainIndiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtMainIndiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'fiscalPeriod', u'revenue', u'grossProfit', u'nIncomeAttrP', u'NIncomeCut', u'basicEPS', u'dilutedEPS', u'basicEPSCut', u'dilutedEPSCut', u'ROEW', u'ROECutW', u'NCFOperAPS', u'NAssetPS', u'AssetLiabRatio', u'grossProfitRatio', u'operateProfitRatio', u'nIncomeRatio', u'revenueYOY', u'grossProfitYOY', u'nIncomeAttrPYOY', u'nIncomeCutYOY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','fiscalPeriod': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtMIndiGet(ticker = "", secID = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    A股上市公司根据利润表计算的财务指标及数据
    
    :param ticker: 股票交易代码，如'600000',可以是列表,ticker、secID至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600000.XSHG',可以是列表,ticker、secID至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtMIndi.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtMIndiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtMIndiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'endDate', u'fiscalPeriod', u'revenue', u'revenueYOY', u'grossProfit', u'grossProfitYOY', u'nIncomeAttrP', u'nIncomeAttrPYOY', u'grossProfitRatio', u'operateProfitRatio', u'nIncomeRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','fiscalPeriod': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtBSInduAlGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    一般工商业资产负债表，最新一次报表发布的年度数据（含科创板）。
    
    :param ticker: 交易代码,如'000002',可以是列表
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,可空
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSInduAl.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtBSInduAlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtBSInduAlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'ticker', u'endYear', u'cashCEquiv', u'settProv', u'loanToOthBankFI', u'tradingFA', u'notesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFA', u'inventories', u'NCAWithin1Y', u'othCA', u'CAE', u'CAA', u'TCA', u'disburLA', u'availForSaleFA', u'htmInvest', u'LTReceiv', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'NCAE', u'NCAA', u'TNCA', u'AE', u'AA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFI', u'tradingFL', u'notesPayable', u'AP', u'advanceReceipts', u'soldForRepurFA', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'NCLWithin1Y', u'accruedExp', u'othCl', u'CLE', u'CLA', u'TCL', u'LTBorr', u'bondPayable', u'LTPayable', u'specificPayables', u'estimatedLiab', u'deferRevenue', u'deferTaxLiab', u'othNCL', u'NCLE', u'NCLA', u'TNCL', u'LE', u'LA', u'TLiab', u'paidInCapital', u'capitalReser', u'treasuryShare', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSe', u'othEffectSa', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtISInduAlGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    一般工商业利润表，最新一次报表发布的年度数据（含科创板）。
    
    :param ticker: 交易代码,如'000002',可以是列表
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,可空
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInduAl.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtISInduAlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtISInduAlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'ticker', u'endDate', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'specOr', u'AOR', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'specToc', u'atoc', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOp', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'othEffectTp', u'aeEffectTp', u'TProfit', u'incomeTax', u'othEffectNp', u'aeEffectNp', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeBma', u'NIncomeAttrP', u'minorityGain', u'othEffectNpp', u'aeEffectNpp', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCi', u'aeEffectCi', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPci', u'aeEffectPci']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtCFsAlGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    上市公司披露根据间接法编制经营活动现金流的现金流量表补充资料（仅有合并报表数据）
    
    :param ticker: 股票代码,可以是列表
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,可空
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFsAl.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtCFsAlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtCFsAlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'endDateRep', u'reportType', u'fiscalPeriod', u'mergedFlag', u'accoutingStandards', u'currencyCD', u'NIncome', u'assetsImpairLoss', u'FAOGPBDepr', u'intanAssetsAmor', u'LTAmorExpAmor', u'amorExpDecr', u'accrExpIncr', u'dispFaOthLoss', u'FAWritOff', u'FValueChgLoss', u'finanExp', u'invLoss', u'deferTaDecr', u'deferTlIncr', u'invenDecr', u'operReceiDecr', u'operPayaIncr', u'other', u'specNOCF1', u'ANOCF1', u'NCFOperateANotes', u'contrANOCF', u'convDebtCapi', u'convBonds1Y', u'finanLeaFA', u'CEndBal', u'CBegBal', u'CEEndBal', u'CEBegBal', u'specC', u'AC', u'NChangeInCash', u'contrANC']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','reportType': 'str','mergedFlag': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtISFinexpPsAlGet(ticker = "", beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    上市公司财务费用附注明细（每年度最新，含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、beginYear、endYear至少选择一个
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,ticker、beginYear、endYear至少选择一个
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,ticker、beginYear、endYear至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISFinexpPsAl.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtISFinexpPsAlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtISFinexpPsAlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'infoSource', u'intExp', u'intExpCapital', u'intIncome', u'intExpDisc', u'intIncomeDisc', u'NIntExp', u'FOccuExp', u'FOccuIncome', u'forexLoss', u'forexLossCapital', u'forexGain', u'forexNLoss', u'CDiscount', u'commission', u'secuExp', u'othFinExp', u'othFinIncome', u'finExp']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','infoSource': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtISBankAlGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    银行业利润表，最新一次报表发布的年度数据
    
    :param ticker: 交易代码,如'000002',可以是列表
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,可空
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISBankAl.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtISBankAlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtISBankAlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'ticker', u'endDate', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'specOr', u'AOR', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'specOP', u'AOP', u'othEffectOp', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTp', u'aeEffectTp', u'TProfit', u'incomeTax', u'othEffectNp', u'aeEffectNp', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othEffectNpp', u'aeEffectNpp', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCi', u'aeEffectCi', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPci', u'aeEffectPci']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyID': 'str','ticker': 'str','endDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtBSBankAlGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    银行业资产负债表，最新一次报表发布的年度数据
    
    :param ticker: 交易代码,如'000002',可以是列表
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,可空
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSBankAl.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtBSBankAlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtBSBankAlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'ticker', u'endYear', u'cReserCB', u'deposInOthBFI', u'preciMetals', u'loanToOthBankFI', u'tradingFA', u'derivAssets', u'purResaleFA', u'intReceiv', u'disburLA', u'finanLeaseReceiv', u'availForSaleFA', u'htmInvest', u'investAsReceiv', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'intanAssets', u'goodwill', u'deferTaxAssets', u'othAssets', u'AE', u'AA', u'TAssets', u'CBBorr', u'deposFrOthBFI', u'loanFrOthBankFI', u'tradingFL', u'derivLiab', u'soldForRepurFA', u'depos', u'payrollPayable', u'taxesPayable', u'intPayable', u'estimatedLiab', u'bondPayable', u'deferTaxLiab', u'othLiab', u'LE', u'LA', u'TLiab', u'paidInCapital', u'capitalReser', u'treasuryShare', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSe', u'othEffectSa', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyID': 'str','ticker': 'str','endYear': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtBankTLoanGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    获取银行业上市公司在扣除贷款减值准备前的贷款总额
    
    :param ticker: 交易代码,如'000002',可以是列表
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,可空
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBankTLoan.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtBankTLoanGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtBankTLoanGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'ticker', u'endYear', u'tLoan']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyID': 'str','ticker': 'str','endYear': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtMIndiCalcQGet(secID = "", ticker = "", year = "", reportType = "", field = "", pandas = "1"):
    """
    单季度主要财务指标及数据（季度值），包含营业收入，摊薄每股收益，每股净资产，净资产收益率的单季度数据，通过财务报表数据计算所得（含科创板）。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param year: 所需调用数据所在年度,可以是列表,可空
    :param reportType: 报告类型。Q1-第一季度，Q2-第二季度，Q3-第三季度，Q4-第四季度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtMIndiCalcQ.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtMIndiCalcQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtMIndiCalcQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'year', u'reportType', u'revenue', u'nIncomeAttrP', u'EPS', u'nAssetsPS', u'ROE']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtISSgaPsMYGet(ticker = "", beginYear = "", endYear = "", itemCD = "", field = "", pandas = "1"):
    """
    上市公司业务及管理费附注（每年度主要明细科目），包含职工薪酬及福利，折旧及摊销情况
    
    :param ticker: 交易代码,如'000002',可以是列表,ticker、beginYear、endYear至少选择一个
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,ticker、beginYear、endYear至少选择一个
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,ticker、beginYear、endYear至少选择一个
    :param itemCD: 科目代码。2037-业务及管理费合计，203701-职工薪酬及福利，203702-折旧及摊销，203703-其他。对应DataAPI.SysCodeGet.codeTypeID=70014。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISSgaPsMY.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&itemCD=")
    if hasattr(itemCD,'__iter__') and not isinstance(itemCD, str):
        if len(itemCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemCD
            requestString.append(None)
        else:
            requestString.append(','.join(itemCD))
    else:
        requestString.append(itemCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtISSgaPsMYGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtISSgaPsMYGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'year', u'itemCD', u'itemName', u'val']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','year': 'str','itemCD': 'str','itemName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtMainOperGet(secID = "", ticker = "", beginDate = "", endDate = "", ifSum = "", classifCD = "", itemTypeCD = "", field = "", pandas = "1"):
    """
    获取上市公司主营业务构成，收集2010年至现在的主营业务构成情况（年度数据）
    
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param beginDate: 会计期间截止日期,起始时间,如‘20121231’,可空
    :param endDate: 会计期间截止日期,结束时间,如‘20131231’,可空
    :param ifSum: 是否合计：1-是，2-否,可以是列表,可空
    :param classifCD: 主营业务分类方式。101-按行业，102-按产品，103-按地区。对应DataAPI.SysCodeGet.codeTypeID=70016。,可以是列表,可空
    :param itemTypeCD: 经营项目类别代码。对应DataAPI.SysCodeGet.codeTypeID=70018。对金融行业按产品分类（classifCD=102）经营项目进行分级,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtMainOper.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&ifSum=")
    if hasattr(ifSum,'__iter__') and not isinstance(ifSum, str):
        if len(ifSum) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ifSum
            requestString.append(None)
        else:
            requestString.append(','.join(ifSum))
    else:
        requestString.append(ifSum)
    requestString.append("&classifCD=")
    if hasattr(classifCD,'__iter__') and not isinstance(classifCD, str):
        if len(classifCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = classifCD
            requestString.append(None)
        else:
            requestString.append(','.join(classifCD))
    else:
        requestString.append(classifCD)
    requestString.append("&itemTypeCD=")
    if hasattr(itemTypeCD,'__iter__') and not isinstance(itemTypeCD, str):
        if len(itemTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(itemTypeCD))
    else:
        requestString.append(itemTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtMainOperGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtMainOperGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'endDate', u'industryCategory', u'classifCD', u'classif', u'itemTypeCD', u'itemType', u'itemName', u'ifSum', u'MORevenue', u'MOCost', u'MOIncome', u'MORevenueLY', u'MOCostLY', u'MOIncomeLY', u'MORevenueYOY', u'MOCostYOY', u'MOIncomeYOY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','industryCategory': 'str','classifCD': 'str','classif': 'str','itemTypeCD': 'str','itemType': 'str','itemName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtBSInsuAlGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    保险业资产负债表，最新一次报表发布的年度数据
    
    :param ticker: 交易代码,如'000002',可以是列表
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,可空
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSInsuAl.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtBSInsuAlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtBSInsuAlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'ticker', u'endYear', u'cashCEquiv', u'loanToOthBankFi', u'tradingFA', u'derivAssets', u'purResaleFa', u'intReceiv', u'premiumReceiv', u'subrogRecoReceiv', u'reinsurReceiv', u'RRReinsUnePrem', u'RRReinsOutstdCla', u'RRReinsLinsLiab', u'RRReinsLThinsLiab', u'PHPledgeLoans', u'fixedTermDepos', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'refundCapDepos', u'investRealEstate', u'fixedAssets', u'intanAssets', u'indepAccAssets', u'deferTaxAssets', u'othAssets', u'AE', u'AA', u'TAssets', u'STBorr', u'loanFrOthBankFi', u'tradingFL', u'derivLiab', u'soldForRepurFa', u'premReceivAdva', u'commisPayable', u'reinsurPayable', u'payrollPayable', u'taxesPayable', u'indemAccPayable', u'policyDivPayable', u'PHInvest', u'reserUnePrem', u'reserOutstdClaims', u'reserLinsLiab', u'reserLthinsLiab', u'LTBorr', u'bondPayable', u'indeptAccLiab', u'deferTaxLiab', u'othLiab', u'LE', u'LA', u'TLiab', u'paidInCapital', u'capitalReser', u'treasuryShare', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSe', u'othEffectSa', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FdmtISInsuAlGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    保险业利润表，最新一次报表发布的年度数据
    
    :param ticker: 交易代码,如'000002',可以是列表
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,可空
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInsuAl.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FdmtISInsuAlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FdmtISInsuAlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'ticker', u'endYear', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'specOr', u'AOR', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'commisExp', u'genlAdminExp', u'reinsCostRefund', u'othOperCosts', u'assetsImpairLoss', u'specOP', u'AOP', u'othEffectOp', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTp', u'aeEffectTp', u'TProfit', u'incomeTax', u'othEffectNp', u'aeEffectNp', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othEffectNpp', u'aeEffectNpp', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCi', u'aeEffectCi', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPci', u'aeEffectPci']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtIndustryGet(ticker = "", field = "", pandas = "1"):
    """
    所有上市公司最新披露一期数据资产负债表所属行业分类
    
    :param ticker: 交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtIndustry.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtIndustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtIndustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'industryCategory']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','industryCategory': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __PartyFdmtIndiBSGet(partyID = "", beginDate = "", endDate = "", isLatest = "", field = "", pandas = "1"):
    """
    根据资产负债表中科目计算的财务指标，例如：流动比率、速动比率。
    
    :param partyID: 机构内部ID,可以是列表,partyID、beginDate、endDate、isLatest至少选择一个
    :param beginDate: 会计期末，起始时间，输入格式“YYYYMMDD”,partyID、beginDate、endDate、isLatest至少选择一个
    :param endDate: 会计期末，结束时间，输入格式“YYYYMMDD”,partyID、beginDate、endDate、isLatest至少选择一个
    :param isLatest: 是否最新会计期间，1-是，0-否,可以是列表,partyID、beginDate、endDate、isLatest至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getPartyFdmtIndiBS.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&isLatest=")
    if hasattr(isLatest,'__iter__') and not isinstance(isLatest, str):
        if len(isLatest) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isLatest
            requestString.append(None)
        else:
            requestString.append(','.join(isLatest))
    else:
        requestString.append(isLatest)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__PartyFdmtIndiBSGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__PartyFdmtIndiBSGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'endDate', u'isLatest', u'currentRatio', u'quickRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtISSecuAllFiscalTGet(ticker = "", secID = "", reportType = "", year = "", beginYear = "", endYear = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据（主要是证券业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；4、本表中单位为人民币元；5、每季更新；6、收录每一会计期间最新披露的财务数据；7、整合了单季度和累计的报表。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType、year至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType、year至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType、year至少选择一个
    :param year: 年度,可以是列表,ticker、secID、reportType、year至少选择一个
    :param beginYear: 年度，开始时间，输入格式“YYYY”,可空
    :param endYear: 年度，结束时间，输入格式“YYYY”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtISSecuAllFiscalT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtISSecuAllFiscalTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtISSecuAllFiscalTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'year', u'reportType', u'revenue', u'NIntIncome', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'effectOR', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'effectOC', u'effectOP', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'effectTP', u'TProfit', u'incomeTax', u'effectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'effectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'effectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'effectPCI']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtISInsuAllFiscalTGet(ticker = "", secID = "", reportType = "", year = "", beginYear = "", endYear = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据（主要是保险业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；4、本表中单位为人民币元；5、每季更新；6、收录每一会计期间最新披露的财务数据；7、整合了单季度和累计的报表。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType、year至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType、year至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType、year至少选择一个
    :param year: 年度,可以是列表,ticker、secID、reportType、year至少选择一个
    :param beginYear: 年度，开始时间，输入格式“YYYY”,可空
    :param endYear: 年度，结束时间，输入格式“YYYY”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtISInsuAllFiscalT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtISInsuAllFiscalTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtISInsuAllFiscalTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'year', u'reportType', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'effectOR', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'commisExp', u'bizTaxSurchg', u'genlAdminExp', u'reinsCostRefund', u'assetsImpairLoss', u'othOperCosts', u'effectOC', u'effectOP', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'effectTP', u'TProfit', u'incomeTax', u'effectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'effectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'effectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'effectPCI']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtISInduAllFiscalTGet(ticker = "", secID = "", reportType = "", year = "", beginYear = "", endYear = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据（主要是一般工商业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；4、本表中单位为人民币元；5、每季更新；6、收录每一会计期间最新披露的财务数据；7、整合了单季度和累计的报表。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType、year至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType、year至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType、year至少选择一个
    :param year: 年度,可以是列表,ticker、secID、reportType、year至少选择一个
    :param beginYear: 年度，开始时间，输入格式“YYYY”,可空
    :param endYear: 年度，结束时间，输入格式“YYYY”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtISInduAllFiscalT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtISInduAllFiscalTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtISInduAllFiscalTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'year', u'reportType', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'effectTOR', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'effectTOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'effectOP', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'effectTP', u'TProfit', u'incomeTax', u'effectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'effectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'effectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'effectPCI']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtISBankAllFiscalTGet(ticker = "", secID = "", reportType = "", year = "", beginYear = "", endYear = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据（主要是银行业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；4、本表中单位为人民币元；5、每季更新；6、收录每一会计期间最新披露的财务数据；7、整合了单季度和累计的报表。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType、year至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType、year至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType、year至少选择一个
    :param year: 年度,可以是列表,ticker、secID、reportType、year至少选择一个
    :param beginYear: 年度，开始时间，输入格式“YYYY”,可空
    :param endYear: 年度，结束时间，输入格式“YYYY”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtISBankAllFiscalT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtISBankAllFiscalTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtISBankAllFiscalTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'year', u'reportType', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'effectOR', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'effectOC', u'effectOP', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'effectTP', u'TProfit', u'incomeTax', u'effectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'effectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'effectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'effectPCI']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtCFSecuAllFiscalTGet(ticker = "", secID = "", reportType = "", year = "", beginYear = "", endYear = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据（主要是证券业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；4、本表中单位为人民币元；5、每季更新；6、收录每一会计期间最新披露的财务数据；7、整合了单季度和累计的报表。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType、year至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType、year至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType、year至少选择一个
    :param year: 年度,可以是列表,ticker、secID、reportType、year至少选择一个
    :param beginYear: 年度，开始时间，输入格式“YYYY”,可空
    :param endYear: 年度，结束时间，输入格式“YYYY”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtCFSecuAllFiscalT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtCFSecuAllFiscalTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtCFSecuAllFiscalTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'year', u'reportType', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'effectOCIF', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'effectOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'effect_CIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'effectCOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'effectFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'effectFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'effectCE', u'NChangeInCash', u'NCEBegBal', u'effectCEI', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtCFInsuAllFiscalTGet(ticker = "", secID = "", reportType = "", year = "", beginYear = "", endYear = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据（主要是保险业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；4、本表中单位为人民币元；5、每季更新；6、收录每一会计期间最新披露的财务数据；7、整合了单季度和累计的报表。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType、year至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType、year至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType、year至少选择一个
    :param year: 年度,可以是列表,ticker、secID、reportType、year至少选择一个
    :param beginYear: 年度，开始时间，输入格式“YYYY”,可空
    :param endYear: 年度，结束时间，输入格式“YYYY”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtCFInsuAllFiscalT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtCFInsuAllFiscalTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtCFInsuAllFiscalTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'year', u'reportType', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'effectOCIF', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'effectOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'effect_CIF', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'effectCOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'effectFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'effectFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'effectCE', u'NChangeInCash', u'NCEBegBal', u'effectCEI', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtCFInduAllFiscalTGet(ticker = "", secID = "", reportType = "", year = "", beginYear = "", endYear = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据（主要是一般工商业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；4、本表中单位为人民币元；5、每季更新；6、收录每一会计期间最新披露的财务数据；7、整合了单季度和累计的报表。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType、year至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType、year至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType、year至少选择一个
    :param year: 年度,可以是列表,ticker、secID、reportType、year至少选择一个
    :param beginYear: 年度，开始时间，输入格式“YYYY”,可空
    :param endYear: 年度，结束时间，输入格式“YYYY”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtCFInduAllFiscalT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtCFInduAllFiscalTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtCFInduAllFiscalTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'year', u'reportType', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'effectOCIF', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'effectOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'effect_CIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'effectCOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'effectFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'effectFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'effectCE', u'NChangeInCash', u'NCEBegBal', u'effectCEI', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtCFBankAllFiscalTGet(ticker = "", secID = "", reportType = "", year = "", beginYear = "", endYear = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据（主要是银行业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；4、本表中单位为人民币元；5、每季更新；6、收录每一会计期间最新披露的财务数据；7、整合了单季度和累计的报表。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType、year至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType、year至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType、year至少选择一个
    :param year: 年度,可以是列表,ticker、secID、reportType、year至少选择一个
    :param beginYear: 年度，开始时间，输入格式“YYYY”,可空
    :param endYear: 年度，结束时间，输入格式“YYYY”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtCFBankAllFiscalT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtCFBankAllFiscalTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtCFBankAllFiscalTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'year', u'reportType', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'effectOCIF', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'effectOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'effect_CIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'effectCOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'effectFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'effectFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'effectCE', u'NChangeInCash', u'NCEBegBal', u'effectCEI', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquFdmtRptPreGet(secID = "", ticker = "", year = "", reportType = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    定期公告预披露(RRP展示专用）
    
    :param secID: 证券ID,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param year: 报告年份,可以是列表,可空
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,可空
    :param beginDate: 最新预约披露日开始时间,可空
    :param endDate: 最新预约披露日结束时间,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPEquFdmtRptPre.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquFdmtRptPreGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquFdmtRptPreGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'year', u'reportType', u'actDate', u'preDate', u'updateDate1', u'updateDate2', u'updateDate3', u'preDateUpdate', u'tAssets', u'tAssetsLY', u'tAssetsOpen', u'tEquityAttrP', u'tEquityAttrPLY', u'tEquityAttrPOpen', u'revenue', u'revenueLY', u'nIncomeAttrP', u'nIncomeAttrPLY', u'niAttrPCut', u'niAttrPCutLY', u'nCFOperateA', u'nCFOperateALY', u'ROEW', u'ROEWLY', u'basicEPS', u'basicEPSLY', u'dilutedEPS', u'dilutedEPSLY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtSmmryGet(secID = "", ticker = "", year = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    财务摘要（rrp展示）
    
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,可空
    :param ticker: 股票代码，如'000002',可以是列表,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",可空
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",可空
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），Q4-第四季报，A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtSmmry.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtSmmryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtSmmryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'endDate', u'fiscalPeriod', u'reportType', u'revenue', u'revenueYOY', u'revenueCAGR3', u'COGS', u'operateProfit', u'operProfitYOY', u'TProfit', u'tProfitYOY', u'NIncome', u'NIYOY', u'NICAGR3', u'NIncomeAttrP', u'niAttrPYOY', u'nrProfitLoss', u'niAttrPCut', u'niAttrPCutYOY', u'EBIT', u'EBITDA', u'TCA', u'fixedAssets', u'LTEquityInvest', u'TAssets', u'taYTD', u'taYOY', u'TCL', u'TNCL', u'TLiab', u'tlYOY', u'TShEquity', u'naYOY', u'TEquityAttrP', u'teAttrPYTD', u'teAttrPYOY', u'capitalReser', u'surplusReser', u'retainedEarnings', u'CFrSaleGS', u'NCFOperateANotes', u'purFixAssetsOth', u'CPaidInvest', u'NCFFrInvestA', u'CFrCapContr', u'CFrBorr', u'NCFFrFinanA', u'NChangeInCash', u'NCEEndBal', u'DA', u'CFsgsR', u'grossMARgin', u'sellExpTR', u'adminExpTR', u'finanExpTR', u'itTp', u'npMARgin', u'EBITMARgin', u'EBITDAMARgin', u'ROE', u'ROEW', u'ROA', u'ROIC', u'asseTLiabRatio', u'taTurnover', u'EPS', u'basicEPS', u'dilutedEPS', u'nCFOperAPS', u'divRatio', u'operateProfitRatio', u'equityRatio', u'ARTurnover', u'invenTurnover', u'currentRatio', u'quickRatio', u'nAssetsPS', u'nCInCashPS', u'naYTD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPMainOperIncomeGet(CompanyCode = "", EndDate = "", Classification = "", IfMerged = "", IfAdjusted = "", IfSum = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    主营业务构成（聚源同步RRP展示用）
    
    :param CompanyCode: 公司代码,可以是列表,可空
    :param EndDate: 截止日期,可以是列表,可空
    :param Classification: 分类方式。10-按行业，20-按产品，30-按地区。,可以是列表,可空
    :param IfMerged: 合并标志。1-合并，2-母公司,可空
    :param IfAdjusted: 调整标志。1-调整，2-未调整,可空
    :param IfSum: 是否合计。1-是，0-否。,可以是列表,可空
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,可空
    :param ticker: 股票代码，如'000002',可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPMainOperIncome.csv?ispandas=1&') 
    requestString.append("CompanyCode=")
    if hasattr(CompanyCode,'__iter__') and not isinstance(CompanyCode, str):
        if len(CompanyCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = CompanyCode
            requestString.append(None)
        else:
            requestString.append(','.join(CompanyCode))
    else:
        requestString.append(CompanyCode)
    requestString.append("&EndDate=")
    if hasattr(EndDate,'__iter__') and not isinstance(EndDate, str):
        if len(EndDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = EndDate
            requestString.append(None)
        else:
            requestString.append(','.join(EndDate))
    else:
        requestString.append(EndDate)
    requestString.append("&Classification=")
    if hasattr(Classification,'__iter__') and not isinstance(Classification, str):
        if len(Classification) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = Classification
            requestString.append(None)
        else:
            requestString.append(','.join(Classification))
    else:
        requestString.append(Classification)
    if not isinstance(IfMerged, str) and not isinstance(IfMerged, unicode):
        IfMerged = str(IfMerged)

    requestString.append("&IfMerged=%s"%(IfMerged))
    if not isinstance(IfAdjusted, str) and not isinstance(IfAdjusted, unicode):
        IfAdjusted = str(IfAdjusted)

    requestString.append("&IfAdjusted=%s"%(IfAdjusted))
    requestString.append("&IfSum=")
    if hasattr(IfSum,'__iter__') and not isinstance(IfSum, str):
        if len(IfSum) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = IfSum
            requestString.append(None)
        else:
            requestString.append(','.join(IfSum))
    else:
        requestString.append(IfSum)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPMainOperIncomeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPMainOperIncomeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'CompanyCode', u'secID', u'EndDate', u'ticker', u'DateType', u'InfoSource', u'IfMerged', u'IfAdjusted', u'Classification', u'itemParentNO', u'SN', u'Project', u'Industry', u'IfSum', u'MainOperIncome', u'MainOperCost', u'MainOperProfit', u'GrossProfit', u'tRevenuePctge', u'tCOGSPctge', u'MainOperIncomeFormerYear', u'MainOperCostFormerYear', u'MainOperProfitFormerYear', u'MainIncomeGrowRateYOY', u'MainICostGrowRateYOY', u'MainProfitGrowRateYOY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','InfoSource': 'str','Project': 'str','Industry': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtEEGet(ticker = "", secID = "", equTypeCD = "", listStatusCD = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    获取2007年及以后年度上市公司披露的业绩快报中的主要财务指标等其他数据，包括本期，去年同期，及本期与期初数值同比数据。每季证券交易所披露相关公告时更新数据，公司ipo时发布相关信息也会同时更新。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param equTypeCD: 股票分类代码，输入A或B可查询获取到A股或B股,可以是列表,可空
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市；O-其他。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,可空
    :param endDate: 根据发布日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param beginDate: 根据发布日期范围查询的起始日期，输入格式“YYYYMMDD”,可空
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",可空
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",可空
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报（7-9月），CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtEE.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&equTypeCD=")
    if hasattr(equTypeCD,'__iter__') and not isinstance(equTypeCD, str):
        if len(equTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = equTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(equTypeCD))
    else:
        requestString.append(equTypeCD)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtEEGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtEEGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'equTypeCD', u'listStatusCD', u'publishDate', u'year', u'reportType', u'revenue', u'primeOperRev', u'grossProfit', u'operateProfit', u'TProfit', u'NIncomeAttrP', u'NIncomeCut', u'NCfOperA', u'basicEPS', u'EPSW', u'EPSCut', u'EPSCutW', u'ROE', u'ROEW', u'ROECut', u'ROECutW', u'NCfOperAPs', u'TAssets', u'TEquityAttrP', u'paidInCapital', u'NAssetPS', u'revenueLY', u'primeOperRevLY', u'grossProfitLY', u'operProfitLY', u'TProfitLY', u'NIncomeAttrPLY', u'NIncomeCutLY', u'NCfOperALY', u'basicEPSLY', u'EPSWLY', u'EPSCutLY', u'EPSCutWLY', u'ROELY', u'ROEWLY', u'ROECutLY', u'ROECutWLY', u'NCfOperAPsLY', u'TAssetsLY', u'TEquityAttrPLY', u'NAssetPsLY', u'revenueYOY', u'primeOperRevYOY', u'grossProfitYOY', u'operProfitYOY', u'TProfitYOY', u'NIncomeAttrPYOY', u'NIncomeCutYOY', u'NCFOperAYOY', u'basicEPSYOY', u'EPSWYOY', u'EPSCutYOY', u'EPSCutWYOY', u'ROEYOY', u'ROEWYOY', u'ROECutYOY', u'ROECutWYOY', u'NCfOperAPsYOY', u'TAssetsYOY', u'TEquityAttrPYOY', u'NAssetPsYOY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','equTypeCD': 'str','listStatusCD': 'str','year': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtEFGet(ticker = "", secID = "", equTypeCD = "", listStatusCD = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", forecastTypeCD = "", field = "", pandas = "1"):
    """
    1、获取2007年及以后年度上市公司披露的公告中的预期下一报告期收入、净利润、归属于母公司净利润、基本每股收益及其幅度变化数据。 2、上市公司对经营成果科目的预计情况数据一般为其上限与下限，上限取值为公告中披露该科目中绝对值较大值，下限取值为公告中披露该科目中绝对值较小值。 3、数值为"正"代表该公司预计盈利，数值为"负"代表该公司预计亏损。若上下限"正"、"负"符号不同，代表该公司盈利亏损情况尚不确定。 4、业绩预期类型以公告中文字披露预期类型为准，若公告中未有文字披露预期类型，则根据数据情况判断预期类型。 5、每季证券交易所披露相关公告时更新数据，公司ipo时发布相关信息也会同时更新。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param equTypeCD: 股票分类代码，输入A或B可查询获取到A股或B股,可以是列表,可空
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市；O-其他。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,可空
    :param endDate: 根据发布日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,可空
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",可空
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",可空
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报（7-9月），CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,可空
    :param forecastTypeCD: 业绩预期类型。对应DataAPI.SysCodeGet.codeTypeID=70006。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtEF.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&equTypeCD=")
    if hasattr(equTypeCD,'__iter__') and not isinstance(equTypeCD, str):
        if len(equTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = equTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(equTypeCD))
    else:
        requestString.append(equTypeCD)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&forecastTypeCD=")
    if hasattr(forecastTypeCD,'__iter__') and not isinstance(forecastTypeCD, str):
        if len(forecastTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = forecastTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(forecastTypeCD))
    else:
        requestString.append(forecastTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtEFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtEFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'equTypeCD', u'listStatusCD', u'publishDate', u'year', u'reportType', u'forecastTypeCD', u'forecastType', u'revChgrLL', u'revChgrUPL', u'expRevLL', u'expRevUPL', u'NIncomeChgrLL', u'NIncomeChgrUPL', u'expnIncomeLL', u'expnIncomeUPL', u'forecastContent', u'createTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','equTypeCD': 'str','listStatusCD': 'str','year': 'str','reportType': 'str','forecastTypeCD': 'str','forecastType': 'str','forecastContent': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中各个会计期间的资产负债表数据；  2、仅收集合并报表数据，包括期末和期初数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBS.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'settProv', u'loanToOthBankFi', u'tradingFA', u'NotesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'inventories', u'NCAWithin1Y', u'othCA', u'TCA', u'disburLA', u'availForSaleFa', u'htmInvest', u'LTReceive', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'TNCA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'NotesPayable', u'AP', u'advanceReceipts', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'NCLWithin1Y', u'othCL', u'TCL', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'LTPayable', u'specificPayables', u'estimatedLiab', u'deferTaxLiab', u'othNCL', u'TNCL', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSBankGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的资产负债表数据；（主要是银行业上市公司）  2、仅收集合并报表数据，包括期末和期初数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSBank.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSBankGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSBankGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'loanToOthBankFi', u'tradingFA', u'intReceiv', u'purResaleFa', u'disburLA', u'availForSaleFA', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'intanAssets', u'goodwill', u'deferTaxAssets', u'CReserCB', u'deposInOthBfi', u'preciMetals', u'derivAssets', u'finanLeaseReceiv', u'investAsReceiv', u'othAssets', u'AE', u'AA', u'TAssets', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'payrollPayable', u'taxesPayable', u'intPayable', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'estimatedLiab', u'deferTaxLiab', u'deposFrOthBfi', u'derivLiab', u'othLiab', u'LE', u'LA', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSE', u'othEffectSA', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSSecuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的资产负债表数据；（主要是证券业上市公司）  2、仅收集合并报表数据，包括期末和期初数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSSecu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSSecuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSSecuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'clientDepos', u'settProv', u'clientProv', u'loanToOthBankFi', u'tradingFA', u'intReceiv', u'purResaleFa', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'intanAssets', u'transacSeatFee', u'deferTaxAssets', u'derivAssets', u'refundDepos', u'othAssets', u'AE', u'AA', u'TAssets', u'STBorr', u'pledgeBorr', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'payrollPayable', u'taxesPayable', u'intPayable', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'estimatedLiab', u'deferTaxLiab', u'derivLiab', u'othLiab', u'LE', u'LA', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'transacRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSE', u'othEffectSA', u'TShEquity', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSInduGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的资产负债表数据；（主要是一般工商业上市公司）  2、仅收集合并报表数据，包括期末和期初数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'settProv', u'loanToOthBankFi', u'tradingFA', u'derivAssets', u'NotesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'inventories', u'assetsHeldForSale', u'NCAWithin1Y', u'othCA', u'CAE', u'CAA', u'TCA', u'disburLA', u'availForSaleFa', u'htmInvest', u'LTReceive', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'NCAE', u'NCAA', u'TNCA', u'AE', u'AA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'derivLiab', u'NotesPayable', u'AP', u'advanceReceipts', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'liabHeldForSale', u'NCLWithin1Y', u'accruedExp', u'othCL', u'CLE', u'CLA', u'TCL', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'LTPayable', u'LTPayrollPayable', u'specificPayables', u'estimatedLiab', u'deferRevenue', u'deferTaxLiab', u'othNCL', u'NCLE', u'NCLA', u'TNCL', u'LE', u'LA', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSE', u'othEffectSA', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSInsuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的资产负债表数据；（主要是保险业上市公司）  2、仅收集合并报表数据，包括期末和期初数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元。  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSInsu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSInsuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSInsuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'loanToOthBankFi', u'tradingFA', u'premiumReceiv', u'reinsurReceiv', u'intReceiv', u'purResaleFa', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'intanAssets', u'deferTaxAssets', u'derivAssets', u'subrogRecoReceiv', u'RRReinsUnePrem', u'RRReinsOutstdCla', u'RRReinsLinsLiab', u'RRReinsLThinsLiab', u'PHPledgeLoans', u'fixedTermDepos', u'refundCapDepos', u'indepAccAssets', u'othAssets', u'AE', u'AA', u'TAssets', u'STBorr', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'reinsurPayable', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'deferTaxLiab', u'derivLiab', u'premReceivAdva', u'indemAccPayable', u'policyDivPayable', u'PHInvest', u'reserUnePrem', u'reserOutstdClaims', u'reserLinsLiab', u'reserLthinsLiab', u'indeptAccLiab', u'othLiab', u'LE', u'LA', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSE', u'othEffectSA', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中各个会计期间的现金流量表数据；  2、仅收集合并报表数据，包括本期和上期数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCF.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFBankGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的现金流量表数据；（主要是银行业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFBank.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFBankGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFBankGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'specOCIF', u'AOCIF', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'specOCOF', u'AOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'specICIF', u'AICIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'specICOF', u'AICOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'specFCIF', u'AFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'specFCOF', u'AFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'othEffectCE', u'ACE', u'NChangeInCash', u'NCEBegBal', u'othEffectCEI', u'ACEI', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFSecuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的现金流量表数据；（主要是证券业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG ',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFSecu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFSecuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFSecuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'specOCIF', u'AOCIF', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'specOCOF', u'AOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'specICIF', u'AICIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'specICOF', u'AICOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'specFCIF', u'AFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'specFCOF', u'AFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'othEffectCE', u'ACE', u'NChangeInCash', u'NCEBegBal', u'othEffectCEI', u'ACEI', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFInduGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的现金流量表数据；（主要是一般工商业上市公司）  2、仅收集合并报表数据，包括本期和上期数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'specOCIF', u'AOCIF', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'specOCOF', u'AOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'specICIF', u'AICIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'specICOF', u'AICOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'specFCIF', u'AFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'specFCOF', u'AFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'othEffectCE', u'ACE', u'NChangeInCash', u'NCEBegBal', u'othEffectCEI', u'ACEI', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFInsuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的现金流量表数据；（主要是保险业上市公司）  2、仅收集合并报表数据，包括本期和上期数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFInsu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFInsuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFInsuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'specOCIF', u'AOCIF', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'specOCOF', u'AOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'specICIF', u'AICIF', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'specICOF', u'AICOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'specFCIF', u'AFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'specFCOF', u'AFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'othEffectCE', u'ACE', u'NChangeInCash', u'NCEBegBal', u'othEffectCEI', u'ACEI', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并利润表模板，收集了2007年以来新三板挂牌公司定期报告中各个会计期间的利润表数据；  2、仅收集合并报表数据，包括本期和上期数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtIS.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISBankGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业利润表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的利润表数据；（主要是银行业上市公司）  2、仅收集合并报表数据，包括本期和上期数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISBank.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISBankGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISBankGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'othOperRev', u'specOR', u'AOR', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'specOC', u'AOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othEffectNPP', u'AEEffectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCI', u'AEEffectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPCI', u'AEEffectPCI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISSecuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业利润表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的利润表数据；（主要是证券业上市公司）  2、仅收集合并报表数据，包括本期和上期数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISSecu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    if not isinstance(fiscalPeriod, str) and not isinstance(fiscalPeriod, unicode):
        fiscalPeriod = str(fiscalPeriod)

    requestString.append("&fiscalPeriod=%s"%(fiscalPeriod))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISSecuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISSecuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'NIntIncome', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'othOperRev', u'specOR', u'AOR', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'specOC', u'AOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othEffectNPP', u'AEEffectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCI', u'AEEffectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPCI', u'AEEffectPCI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISInduGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业利润表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的利润表数据；（主要是一般工商业上市公司）  2、仅收集合并报表数据，包括本期和上期数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    if not isinstance(fiscalPeriod, str) and not isinstance(fiscalPeriod, unicode):
        fiscalPeriod = str(fiscalPeriod)

    requestString.append("&fiscalPeriod=%s"%(fiscalPeriod))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'specTOR', u'ATOR', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'specTOC', u'ATOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'NIncomeBMA', u'minorityGain', u'othEffectNPP', u'AEEffectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCI', u'AEEffectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPCI', u'AEEffectPCI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISInsuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业利润表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的利润表数据；（主要是保险业上市公司）  2、仅收集合并报表数据，包括本期和上期数据；  3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示；  4、本表中单位为人民币元；  5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISInsu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    if not isinstance(fiscalPeriod, str) and not isinstance(fiscalPeriod, unicode):
        fiscalPeriod = str(fiscalPeriod)

    requestString.append("&fiscalPeriod=%s"%(fiscalPeriod))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISInsuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISInsuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'commisExp', u'othOperRev', u'specOR', u'AOR', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'genlAdminExp', u'reinsCostRefund', u'assetsImpairLoss', u'othOperCosts', u'specOC', u'AOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othEffectNPP', u'AEEffectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCI', u'AEEffectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPCI', u'AEEffectPCI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中各个会计期间的资产负债表数据； 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据； 4、本表中单位为人民币元； 5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'settProv', u'loanToOthBankFi', u'tradingFA', u'NotesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'inventories', u'NCAWithin1Y', u'othCA', u'TCA', u'disburLA', u'availForSaleFa', u'htmInvest', u'LTReceive', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'TNCA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'NotesPayable', u'AP', u'advanceReceipts', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'NCLWithin1Y', u'othCL', u'TCL', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'LTPayable', u'specificPayables', u'estimatedLiab', u'deferTaxLiab', u'othNCL', u'TNCL', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity', u'deferRevenue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSBankAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的资产负债表数据（主要是银行业上市公司）； 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据； 4、本表中单位为人民币元； 5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSBankAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSBankAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSBankAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'loanToOthBankFi', u'tradingFA', u'intReceiv', u'purResaleFa', u'disburLA', u'availForSaleFA', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'intanAssets', u'goodwill', u'deferTaxAssets', u'CReserCB', u'deposInOthBfi', u'preciMetals', u'derivAssets', u'finanLeaseReceiv', u'investAsReceiv', u'othAssets', u'TAssets', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'payrollPayable', u'taxesPayable', u'intPayable', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'estimatedLiab', u'deferTaxLiab', u'deposFrOthBfi', u'derivLiab', u'othLiab', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSSecuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的资产负债表数据（主要是证券业上市公司）； 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据； 4、本表中单位为人民币元； 5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSSecuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSSecuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSSecuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'clientDepos', u'settProv', u'clientProv', u'loanToOthBankFi', u'tradingFA', u'intReceiv', u'purResaleFa', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'intanAssets', u'transacSeatFee', u'deferTaxAssets', u'derivAssets', u'refundDepos', u'othAssets', u'TAssets', u'STBorr', u'pledgeBorr', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'payrollPayable', u'taxesPayable', u'intPayable', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'estimatedLiab', u'deferTaxLiab', u'derivLiab', u'othLiab', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'transacRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSInduAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的资产负债表数据（主要是一般工商业上市公司）； 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据； 4、本表中单位为人民币元； 5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSInduAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSInduAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSInduAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'settProv', u'loanToOthBankFi', u'tradingFA', u'derivAssets', u'NotesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'inventories', u'assetsHeldForSale', u'NCAWithin1Y', u'othCA', u'TCA', u'disburLA', u'availForSaleFa', u'htmInvest', u'LTReceive', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'TNCA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'derivLiab', u'NotesPayable', u'AP', u'advanceReceipts', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'liabHeldForSale', u'NCLWithin1Y', u'accruedExp', u'othCL', u'TCL', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'LTPayable', u'LTPayrollPayable', u'specificPayables', u'estimatedLiab', u'deferRevenue', u'deferTaxLiab', u'othNCL', u'TNCL', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtBSInsuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业资产负债表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的资产负债表数据（主要是保险业上市公司）； 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据； 4、本表中单位为人民币元； 5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtBSInsuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtBSInsuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtBSInsuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'loanToOthBankFi', u'tradingFA', u'premiumReceiv', u'reinsurReceiv', u'intReceiv', u'purResaleFa', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'intanAssets', u'deferTaxAssets', u'derivAssets', u'subrogRecoReceiv', u'RRReinsUnePrem', u'RRReinsOutstdCla', u'RRReinsLinsLiab', u'RRReinsLThinsLiab', u'PHPledgeLoans', u'fixedTermDepos', u'refundCapDepos', u'indepAccAssets', u'othAssets', u'TAssets', u'STBorr', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'reinsurPayable', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'deferTaxLiab', u'derivLiab', u'premReceivAdva', u'indemAccPayable', u'policyDivPayable', u'PHInvest', u'reserUnePrem', u'reserOutstdClaims', u'reserLinsLiab', u'reserLthinsLiab', u'indeptAccLiab', u'othLiab', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中各个会计期间的现金流量表数据；2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFBankAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的现金流量表数据（主要是银行业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFBankAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFBankAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFBankAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFSecuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的现金流量表数据（主要是证券业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG ',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFSecuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFSecuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFSecuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFInduAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的现金流量表数据（主要是一般工商业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFInduAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFInduAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFInduAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFInsuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业现金流量表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的现金流量表数据（主要是保险业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFInsuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFInsuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFInsuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并利润表模板，收集了2007年以来新三板挂牌公司定期报告中各个会计期间的利润表数据；2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISBankAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业利润表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的利润表数据（主要是银行业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISBankAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISBankAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISBankAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'specOR', u'AOR']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISSecuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业利润表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的利润表数据（主要是证券业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISSecuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISSecuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISSecuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'NIntIncome', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISInduAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业利润表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的利润表数据（主要是一般工商业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISInduAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISInduAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISInduAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISInsuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业利润表模板，收集了2007年以来新三板挂牌公司定期报告中所有以此模板披露的利润表数据（主要是保险业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、大多公司半年更新一次，少部分公司每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISInsuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISInsuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISInsuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'commisExp', u'othOperRev', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'genlAdminExp', u'reinsCostRefund', u'assetsImpairLoss', u'othOperCosts', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFBankQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据银行业新三板挂牌公司披露的现金流量表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、期间内变动金额计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:若新三板挂牌公司披露第三季度数据，直接取新三板挂牌公司披露数据；若未披露则：前三季度-半年度；Q4:年度-前三季度 5、期初现金及现金等价物余额取上一会计期间期末值；期末现金及现金等价物余额取报表原值 6、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFBankQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFBankQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFBankQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'CPaidInvest', u'purFixAssetsOth', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFInduQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据一般工商业新三板挂牌公司披露的现金流量表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、期间内变动金额计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:若新三板挂牌公司披露第三季度数据，直接取新三板挂牌公司披露数据；若未披露则：前三季度-半年度；Q4:年度-前三季度 5、期初现金及现金等价物余额取上一会计期间期末值；期末现金及现金等价物余额取报表原值 6、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFInduQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFInduQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFInduQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFInsuQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据保险业新三板挂牌公司披露的现金流量表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、期间内变动金额计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:若新三板挂牌公司披露第三季度数据，直接取新三板挂牌公司披露数据；若未披露则：前三季度-半年度；Q4:年度-前三季度 5、期初现金及现金等价物余额取上一会计期间期末值；期末现金及现金等价物余额取报表原值 6、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFInsuQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFInsuQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFInsuQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据各个行业单季度现金流量表表整合的合并单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:直接取新三板挂牌公司披露数据；Q4:年度-前三季度 5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtCFSecuQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据证券业新三板挂牌公司披露的现金流量表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、期间内变动金额计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:若新三板挂牌公司披露第三季度数据，直接取新三板挂牌公司披露数据；若未披露则：前三季度-半年度；Q4:年度-前三季度 5、期初现金及现金等价物余额取上一会计期间期末值；期末现金及现金等价物余额取报表原值 6、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtCFSecuQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtCFSecuQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtCFSecuQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'CPaidInvest', u'purFixAssetsOth', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISBankQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据银行业新三板挂牌公司披露的利润表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:直接取新三板挂牌公司披露数据；Q4:年度-前三季度 5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISBankQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISBankQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISBankQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISInduQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据一般工商业新三板挂牌公司披露的利润表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:直接取新三板挂牌公司披露数据；Q4:年度-前三季度 5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISInduQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISInduQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISInduQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISInsuQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据保险业新三板挂牌公司披露的利润表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:直接取新三板挂牌公司披露数据；Q4:年度-前三季度 5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISInsuQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISInsuQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISInsuQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'commisExp', u'genlAdminExp', u'reinsCostRefund', u'othOperCosts', u'assetsImpairLoss', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据各个行业单季度利润表整合的合并单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:直接取新三板挂牌公司披露数据；Q4:年度-前三季度 5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqFdmtISSecuQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据证券业新三板挂牌公司披露的利润表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、计算逻辑如下：Q1:直接取新三板挂牌公司披露数据；Q2:半年度-第一季度；Q3:直接取新三板挂牌公司披露数据；Q4:年度-前三季度 5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低 7、由于新三板许多公司不披露季度报告，故无法计算季度值，导致数据空缺
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getNeeqFdmtISSecuQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqFdmtISSecuQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqFdmtISSecuQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'revenue', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'NIntIncome', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtNotesTableGet(tableID = "", tableName = "", isPub = "", isRRPPosition = "", stmtParamName = "", field = "", pandas = "1"):
    """
    获取财务附注名称信息
    
    :param tableID: 财务附注表代码,可以是列表,可空
    :param tableName: 财务附注表名称（模糊查询）,可空
    :param isPub: 财务附注数据是否可发布,可空
    :param isRRPPosition: 是否RRP需要关联三大报表参数,可以是列表,可空
    :param stmtParamName: 三大报表参数名称,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtNotesTable.csv?ispandas=1&') 
    requestString.append("tableID=")
    if hasattr(tableID,'__iter__') and not isinstance(tableID, str):
        if len(tableID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tableID
            requestString.append(None)
        else:
            requestString.append(','.join(tableID))
    else:
        requestString.append(tableID)
    if not isinstance(tableName, str) and not isinstance(tableName, unicode):
        tableName = str(tableName)

    requestString.append("&tableName=%s"%(tableName))
    if not isinstance(isPub, str) and not isinstance(isPub, unicode):
        isPub = str(isPub)

    requestString.append("&isPub=%s"%(isPub))
    requestString.append("&isRRPPosition=")
    if hasattr(isRRPPosition,'__iter__') and not isinstance(isRRPPosition, str):
        if len(isRRPPosition) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isRRPPosition
            requestString.append(None)
        else:
            requestString.append(','.join(isRRPPosition))
    else:
        requestString.append(isRRPPosition)
    requestString.append("&stmtParamName=")
    if hasattr(stmtParamName,'__iter__') and not isinstance(stmtParamName, str):
        if len(stmtParamName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = stmtParamName
            requestString.append(None)
        else:
            requestString.append(','.join(stmtParamName))
    else:
        requestString.append(stmtParamName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtNotesTableGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtNotesTableGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tableID', u'tableName', u'tableComment', u'tableCommentEn', u'isPub', u'isRRPPosition', u'stmtParamName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tableName': 'str','tableComment': 'str','tableCommentEn': 'str','stmtParamName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtNotesItemGet(itemID = "", itemName = "", tableID = "", field = "", pandas = "1"):
    """
    获取财务附注科目信息
    
    :param itemID: 财务附注科目代码,可以是列表,可空
    :param itemName: 财务附注科目名称（模糊查询）,可空
    :param tableID: 财务附注表代码，可通过getRRPFdmtNotesTable.tableID获取到对应表信息,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtNotesItem.csv?ispandas=1&') 
    requestString.append("itemID=")
    if hasattr(itemID,'__iter__') and not isinstance(itemID, str):
        if len(itemID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemID
            requestString.append(None)
        else:
            requestString.append(','.join(itemID))
    else:
        requestString.append(itemID)
    if not isinstance(itemName, str) and not isinstance(itemName, unicode):
        itemName = str(itemName)

    requestString.append("&itemName=%s"%(itemName))
    requestString.append("&tableID=")
    if hasattr(tableID,'__iter__') and not isinstance(tableID, str):
        if len(tableID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tableID
            requestString.append(None)
        else:
            requestString.append(','.join(tableID))
    else:
        requestString.append(tableID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtNotesItemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtNotesItemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'itemID', u'itemName', u'tableID', u'itemComment', u'itemCommentEn']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'itemName': 'str','tableID': 'str','itemComment': 'str','itemCommentEn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquFdmtNotesGet(secID = "", ticker = "", isNew = "", beginDate = "", endDate = "", publishDateBegin = "", publishDateEnd = "", tableID = "", itemID = "", title = "", field = "", pandas = "1"):
    """
    获取上市公司财务附注，所有财务附注均储存在本表，其中需要调用的附注信息在getRRPFdmtNotesTable中获取，需要调用的附注科目信息在getRRPFdmtNotesItem中获取
    
    :param secID: 证券代码,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param isNew: 是否最新一次披露,可空
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 根据发布日期范围查询的起始日期，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 根据发布日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param tableID: 财务附注表代码,可以是列表,可空
    :param itemID: 财务附注科目代码，可通过getRRPFdmtNotesItem.itemID获取到对应表信息,可以是列表,可空
    :param title: 财务附注标题代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPEquFdmtNotes.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    requestString.append("&tableID=")
    if hasattr(tableID,'__iter__') and not isinstance(tableID, str):
        if len(tableID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tableID
            requestString.append(None)
        else:
            requestString.append(','.join(tableID))
    else:
        requestString.append(tableID)
    requestString.append("&itemID=")
    if hasattr(itemID,'__iter__') and not isinstance(itemID, str):
        if len(itemID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemID
            requestString.append(None)
        else:
            requestString.append(','.join(itemID))
    else:
        requestString.append(itemID)
    requestString.append("&title=")
    if hasattr(title,'__iter__') and not isinstance(title, str):
        if len(title) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = title
            requestString.append(None)
        else:
            requestString.append(','.join(title))
    else:
        requestString.append(title)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquFdmtNotesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquFdmtNotesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'actPubtime', u'endDateRep', u'endDate', u'fiscalPeriod', u'isNew', u'tableID', u'itemID', u'title', u'orgItemName', u'value']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','itemID': 'str','title': 'str','orgItemName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtPSSharesGet(ticker = "", secID = "", endYear = "", beginYear = "", isLatestShare = "", reportType = "", field = "", pandas = "1"):
    """
    获取上市公司当日股本及每个会计期末EPS及股本数据。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param endYear: 根据会计年度范围查询的结束日期，输入格式“YYYY”,可空
    :param beginYear: 根据会计期末范围查询的起始日期，输入格式“YYYY”,可空
    :param isLatestShare: 是否当日股本,1-是,仅返回今日日股本数量,0-否，返回每个会计期末股本数量及EPS。默认为0。,可空
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。若isLatestShare=1，则返回值为空。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtPSShares.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(isLatestShare, str) and not isinstance(isLatestShare, unicode):
        isLatestShare = str(isLatestShare)

    requestString.append("&isLatestShare=%s"%(isLatestShare))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtPSSharesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtPSSharesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'changeDate', u'totalShares', u'EPS', u'basicEPS', u'dilutedEPS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtNotesTitleGet(titleName = "", title = "", isLabel = "", field = "", pandas = "1"):
    """
    获取财务附注列名对应枚举值及标准化含义，及是否需要对该列打标签
    
    :param titleName: 财务附注列名,可以是列表,可空
    :param title: 财务附注列名代码,可以是列表,可空
    :param isLabel: 是否打标签，1-是，0-否,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtNotesTitle.csv?ispandas=1&') 
    requestString.append("titleName=")
    if hasattr(titleName,'__iter__') and not isinstance(titleName, str):
        if len(titleName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = titleName
            requestString.append(None)
        else:
            requestString.append(','.join(titleName))
    else:
        requestString.append(titleName)
    requestString.append("&title=")
    if hasattr(title,'__iter__') and not isinstance(title, str):
        if len(title) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = title
            requestString.append(None)
        else:
            requestString.append(','.join(title))
    else:
        requestString.append(title)
    requestString.append("&isLabel=")
    if hasattr(isLabel,'__iter__') and not isinstance(isLabel, str):
        if len(isLabel) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isLabel
            requestString.append(None)
        else:
            requestString.append(','.join(isLabel))
    else:
        requestString.append(isLabel)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtNotesTitleGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtNotesTitleGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'titleName', u'title', u'titleNameStandard', u'isLabel']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'titleName': 'str','title': 'str','titleNameStandard': 'str','isLabel': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ZNTGFdmtMainOperNGet(ticker = "", secID = "", endDate = "", beginDate = "", classifCD = "", field = "", pandas = "1"):
    """
    智能投顾用主营构成表
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,可空
    :param classifCD: 主营业务分类方式。1-按行业，2-按产品，3-按地区,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getZNTGFdmtMainOperN.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&classifCD=")
    if hasattr(classifCD,'__iter__') and not isinstance(classifCD, str):
        if len(classifCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = classifCD
            requestString.append(None)
        else:
            requestString.append(','.join(classifCD))
    else:
        requestString.append(classifCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ZNTGFdmtMainOperNGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ZNTGFdmtMainOperNGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'publishDate', u'endDate', u'classifCD', u'mergedFlag', u'fiscalPeriod', u'itemParentNO', u'itemNO', u'itemName', u'revenue', u'revenuePctge', u'cogs', u'costPctge', u'grossMargin']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','fiscalPeriod': 'str','itemName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtMainIndiGet(secID = "", ticker = "", year = "", beginYear = "", endYear = "", reportType = "", updateTime = "", field = "", pandas = "1"):
    """
    所有现有主要财务科目及指标
    
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,可空
    :param ticker: 股票代码，如'000002',可以是列表,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",可空
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",可空
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），Q4-第四季报，A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,可空
    :param updateTime: 更新时间,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtMainIndi.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        updateTime = updateTime.strftime('%Y%m%d')
    except:
        updateTime = updateTime.replace('-', '')
    requestString.append("&updateTime=%s"%(updateTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtMainIndiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtMainIndiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'endDate', u'fiscalPeriod', u'reportType', u'revenue', u'COGS', u'finanExp', u'fValueChgGain', u'investIncome', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'NIncomeAttrP', u'minorityGain', u'CFrSaleGS', u'NCFOperateANotes', u'purFixAssetsOth', u'CPaidInvest', u'NCFFrInvestA', u'CFrCapContr', u'CFrBorr', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEEndBal', u'cashCEquiv', u'AR', u'inventories', u'TCA', u'fixedAssets', u'LTEquityInvest', u'TNCA', u'TAssets', u'AP', u'TCL', u'bondPayable', u'TNCL', u'TLiab', u'capitalReser', u'surplusReser', u'retainedEarnings', u'TEquityAttrP', u'TShEquity', u'tFixedAssets', u'intFreeCl', u'intFreeNcl', u'intCl', u'intDebt', u'nDebt', u'nTanAssets', u'workCapital', u'nWorkCapital', u'IC', u'tRe', u'grossProfit', u'opaProfit', u'valChgProfit', u'nIntExp', u'EBIT', u'EBITDA', u'EBIAT', u'nrProfitLoss', u'niAttrPCut', u'FCFF', u'FCFE', u'DA', u'EPS', u'basicEPS', u'dilutedEPS', u'EPSCut', u'nAssetsPS', u'tRevPS', u'revPS', u'opPS', u'EBITPS', u'cReserPS', u'sReserPS', u'reserPS', u'rePS', u'tRePS', u'nCFOperAPS', u'nCInCashPS', u'FCFFPS', u'FCFEPS', u'tRevenueYOY', u'revenueYOY', u'operProfitYOY', u'tProfitYOY', u'NIYOY', u'niAttrPYOY', u'niAttrPCutYOY', u'basicEPSYOY', u'dilutedEPSYOY', u'ROEYOY', u'nCfOpaYOY', u'nCfOpaPSYOY', u'taYTD', u'tlYTD', u'naYTD', u'teAttrPYTD', u'naPSYTD', u'taYOY', u'tlYOY', u'naYOY', u'teAttrPYOY', u'naPSYOY', u'revenueCAGR3', u'NICAGR3', u'niAttrPCAGR3', u'niAttrPCutCAGR4', u'grossMargin', u'npMargin', u'operateProfitRatio', u'EBITMargin', u'EBITDAMargin', u'ROE', u'ROEA', u'ROEW', u'ROECut', u'ROECutW', u'ROA', u'ROAEBIT', u'ROIC', u'divRatio', u'faTurnover', u'tfaTurnover', u'caTurnover', u'taTurnover', u'invenTurnover', u'daysInven', u'ARTurnover', u'daysAR', u'operCycle', u'APTurnover', u'daysAP', u'currentRatio', u'quickRatio', u'squickRatio', u'opCL', u'opTL', u'asseTLiabRatio', u'equityRatio', u'TLTeap', u'teapTL', u'teapID', u'nTanATL', u'nTanAID', u'nTanANd', u'EBITDATL', u'EBITDAID', u'cashICL', u'cashCL', u'nCFOpaCL', u'nCFOpaLiab', u'nCFOpaID', u'nCFOpaNd', u'nCFOpaNCL', u'nCFNfaCL', u'nCFNfaLiab', u'nCLWc', u'timesInteEBIT', u'timesInteEBITDA', u'timesInteCF', u'arR', u'advRR', u'CFsgsR', u'nCFOpaTR', u'nCFOpaR', u'nCFOpaOpap', u'nCFOpaOp', u'pFixAODa', u'cRcvryA', u'nCFOpaPropt', u'nCFIaPropt', u'nCFFaPropt', u'cTa', u'arTa', u'repayTa', u'invenTa', u'caTa', u'fixedATa', u'tFixedATa', u'intanATa', u'ltAmorExpTa', u'ncaTa', u'apTa', u'advRTa', u'stBorrTa', u'ltBorrTa', u'bpTa', u'nTanATa', u'treTa', u'teapTa', u'tseTa', u'idIc', u'teapIc', u'clTa', u'nclTa', u'equMultiplier', u'capFixRatio', u'rTR', u'TCOGSTR', u'COGSTR', u'btaxSurchgTR', u'periodExpTR', u'sellExpTR', u'adminExpTR', u'finanExpTR', u'ailTR', u'opaPTR', u'valChgPTR', u'fvChgGTR', u'invIncTR', u'opTR', u'nopgTR', u'noplTR', u'tpTR', u'itTR', u'NITR', u'EBITDATR', u'EBITTR', u'opaPTp', u'valChgPTp', u'opTp', u'nNopiTp', u'itTp', u'NICutNI', u'totalShares', u'EBITDAYOY', u'EBITYOY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPFdmtMoStdItemGet(itemID = "", ticker = "", secID = "", endDate = "", beginDate = "", classifCD = "", field = "", pandas = "1"):
    """
    1、上市公司主营业务收入来源2、包含指标营业收入、营业成本、毛利润、毛利率、收入占比、成本占比、收入同比、成本同比、毛利润同比、毛利率同比3、可通过项目代码关联各个报告期项目对比查看多报告期主营业务变化情况
    
    :param itemID: 项目代码,可以是列表,可空
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,可空
    :param classifCD: 分类方式。1-按行业，2-按产品，3-按地区,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRRPFdmtMoStdItem.csv?ispandas=1&') 
    requestString.append("itemID=")
    if hasattr(itemID,'__iter__') and not isinstance(itemID, str):
        if len(itemID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemID
            requestString.append(None)
        else:
            requestString.append(','.join(itemID))
    else:
        requestString.append(itemID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&classifCD=")
    if hasattr(classifCD,'__iter__') and not isinstance(classifCD, str):
        if len(classifCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = classifCD
            requestString.append(None)
        else:
            requestString.append(','.join(classifCD))
    else:
        requestString.append(classifCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPFdmtMoStdItemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPFdmtMoStdItemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'partyID', u'endDate', u'classifCD', u'itemID', u'itemName', u'itemIDSuperior', u'itemNameSuperior', u'pitItemID', u'revenue', u'revenuePctge', u'revenueIsPctge', u'tRevenueIsPctge', u'revenueYOY', u'cogs', u'costPctge', u'cogsIsPctge', u'tCogsIsPctge', u'cogsYOY', u'grossProfit', u'grossProfitYOY', u'grossMargin', u'grossMarginYOY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','itemName': 'str','itemNameSuperior': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FinfStmtBsInduGet(ticker = "", secID = "", endDate = "", beginDate = "", reportType = "", endExpDate = "", beginExpDate = "", expReportType = "", dataTypeCD = "", opinionCD = "", expFactorCD = "", industryCategory = "", field = "", pandas = "1"):
    """
    智能预测模型：一般工商业资产负债表,根据上市公司披露的财务报表，及宏观经济变化情况、行业景气程度、公司在行业中市场地位，自动生成乐观、中性、悲观三种财务数据预测结果
    
    :param ticker: 股票代码，如'000002',可以是列表,可空
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,可空
    :param endDate: 会计期间截止日期查询的截止日期,可空
    :param beginDate: 会计期间截止日期查询的起始日期,可空
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。,可以是列表,可空
    :param endExpDate: 预期根据会计期间截止日期查询的截止日期,可空
    :param beginExpDate: 预期根据会计期间截止日期查询的起始日期,可空
    :param expReportType: 预期根据报告类型。Q1-第一季报，S1-半年报，Q3-三季报，A-年报。,可以是列表,可空
    :param dataTypeCD: 数据类型,可以是列表,可空
    :param opinionCD: 预测观点,可以是列表,可空
    :param expFactorCD: 预测因素,可以是列表,可空
    :param industryCategory: 行业分类,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFinfStmtBsIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endExpDate = endExpDate.strftime('%Y%m%d')
    except:
        endExpDate = endExpDate.replace('-', '')
    requestString.append("&endExpDate=%s"%(endExpDate))
    try:
        beginExpDate = beginExpDate.strftime('%Y%m%d')
    except:
        beginExpDate = beginExpDate.replace('-', '')
    requestString.append("&beginExpDate=%s"%(beginExpDate))
    requestString.append("&expReportType=")
    if hasattr(expReportType,'__iter__') and not isinstance(expReportType, str):
        if len(expReportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = expReportType
            requestString.append(None)
        else:
            requestString.append(','.join(expReportType))
    else:
        requestString.append(expReportType)
    requestString.append("&dataTypeCD=")
    if hasattr(dataTypeCD,'__iter__') and not isinstance(dataTypeCD, str):
        if len(dataTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dataTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(dataTypeCD))
    else:
        requestString.append(dataTypeCD)
    requestString.append("&opinionCD=")
    if hasattr(opinionCD,'__iter__') and not isinstance(opinionCD, str):
        if len(opinionCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = opinionCD
            requestString.append(None)
        else:
            requestString.append(','.join(opinionCD))
    else:
        requestString.append(opinionCD)
    requestString.append("&expFactorCD=")
    if hasattr(expFactorCD,'__iter__') and not isinstance(expFactorCD, str):
        if len(expFactorCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = expFactorCD
            requestString.append(None)
        else:
            requestString.append(','.join(expFactorCD))
    else:
        requestString.append(expFactorCD)
    requestString.append("&industryCategory=")
    if hasattr(industryCategory,'__iter__') and not isinstance(industryCategory, str):
        if len(industryCategory) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryCategory
            requestString.append(None)
        else:
            requestString.append(','.join(industryCategory))
    else:
        requestString.append(industryCategory)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FinfStmtBsInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FinfStmtBsInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secIDInt', u'ticker', u'secShortName', u'partyID', u'expEndDate', u'endDate', u'dataTypeCD', u'opinionCD', u'expFactorCD', u'industryCategory', u'cashCEquiv', u'ar', u'daysAr', u'notesReceiv', u'daysNr', u'inventories', u'daysInven', u'prepayment', u'daysPrepay', u'othCaDer', u'othCaDerR', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'settProv', u'loanToOthBankFi', u'derivAssets', u'tradingFa', u'assetsHeldForSale', u'ncaWithin1Y', u'othCa', u'cae', u'caa', u'tCa', u'ltEquityInvest', u'fixedAssets', u'depr', u'deprPctge', u'cipDer', u'cip', u'constMaterials', u'intanAssets', u'iaAmor', u'iaAmorPctge', u'goodwill', u'ltAmorExp', u'ltaeAmor', u'ltaeAmorPctge', u'othNcaDer', u'othNcaDerR', u'disburLa', u'availForSaleFa', u'htmInvest', u'ltReceiv', u'investRealEstate', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'rD', u'deferTaxAssets', u'othNca', u'ncae', u'ncaa', u'tNca', u'aa', u'tAssets', u'stBorr', u'ap', u'daysAp', u'notesPayable', u'daysNp', u'advanceReceipts', u'daysAdvR', u'othClDer', u'othClDerR', u'cbBorr', u'depos', u'loanFrOthBankFi', u'tradingFl', u'derivLiab', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'liabHeldForSale', u'nclWithin1Y', u'accruedExp', u'othCl', u'cle', u'cla', u'tCl', u'ltBorr', u'ltPayable', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'othNclDer', u'othNclDerR', u'ltPayrollPayable', u'specificPayables', u'estimatedLiab', u'deferRevenue', u'deferTaxLiab', u'othNcl', u'ncle', u'ncla', u'tNcl', u'la', u'tLiab', u'paidInCapital', u'capitalReser', u'treasuryShare', u'reDer', u'dividDistri', u'dividPayRatio', u'retainedEarnings', u'surplusReser', u'othEquity', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'othCompreIncome', u'specialReser', u'ordinRiskReser', u'forexDiffer', u'see', u'sea', u'tEquityAttrP', u'minorityInt', u'othEffectSa', u'tShEquity', u'lea', u'tLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','expFactorCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FinfStmtCfInduGet(ticker = "", secID = "", endDate = "", beginDate = "", reportType = "", endExpDate = "", beginExpDate = "", expReportType = "", dataTypeCD = "", opinionCD = "", expFactorCD = "", industryCategory = "", field = "", pandas = "1"):
    """
    智能预测模型：一般工商业现金流量表,根据上市公司披露的财务报表，及宏观经济变化情况、行业景气程度、公司在行业中市场地位，自动生成乐观、中性、悲观三种财务数据预测结果
    
    :param ticker: 股票代码，如'000002',可以是列表,可空
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,可空
    :param endDate: 会计期间截止日期查询的截止日期,可空
    :param beginDate: 会计期间截止日期查询的起始日期,可空
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。,可以是列表,可空
    :param endExpDate: 预期根据会计期间截止日期查询的截止日期,可空
    :param beginExpDate: 预期根据会计期间截止日期查询的起始日期,可空
    :param expReportType: 预期根据报告类型。Q1-第一季报，Q2-第二季报（单季度），S1-半年报，Q3-第三季报（单季度），CQ3-三季报（累计1-9月），Q4-第四季报（单季度），A-年报。,可以是列表,可空
    :param dataTypeCD: 数据类型,可以是列表,可空
    :param opinionCD: 预测观点,可以是列表,可空
    :param expFactorCD: 预测因素,可以是列表,可空
    :param industryCategory: 行业分类,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFinfStmtCfIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endExpDate = endExpDate.strftime('%Y%m%d')
    except:
        endExpDate = endExpDate.replace('-', '')
    requestString.append("&endExpDate=%s"%(endExpDate))
    try:
        beginExpDate = beginExpDate.strftime('%Y%m%d')
    except:
        beginExpDate = beginExpDate.replace('-', '')
    requestString.append("&beginExpDate=%s"%(beginExpDate))
    requestString.append("&expReportType=")
    if hasattr(expReportType,'__iter__') and not isinstance(expReportType, str):
        if len(expReportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = expReportType
            requestString.append(None)
        else:
            requestString.append(','.join(expReportType))
    else:
        requestString.append(expReportType)
    requestString.append("&dataTypeCD=")
    if hasattr(dataTypeCD,'__iter__') and not isinstance(dataTypeCD, str):
        if len(dataTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dataTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(dataTypeCD))
    else:
        requestString.append(dataTypeCD)
    requestString.append("&opinionCD=")
    if hasattr(opinionCD,'__iter__') and not isinstance(opinionCD, str):
        if len(opinionCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = opinionCD
            requestString.append(None)
        else:
            requestString.append(','.join(opinionCD))
    else:
        requestString.append(opinionCD)
    requestString.append("&expFactorCD=")
    if hasattr(expFactorCD,'__iter__') and not isinstance(expFactorCD, str):
        if len(expFactorCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = expFactorCD
            requestString.append(None)
        else:
            requestString.append(','.join(expFactorCD))
    else:
        requestString.append(expFactorCD)
    requestString.append("&industryCategory=")
    if hasattr(industryCategory,'__iter__') and not isinstance(industryCategory, str):
        if len(industryCategory) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryCategory
            requestString.append(None)
        else:
            requestString.append(','.join(industryCategory))
    else:
        requestString.append(industryCategory)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FinfStmtCfInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FinfStmtCfInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secIDInt', u'ticker', u'secShortName', u'partyId', u'expEndDate', u'endDate', u'fiscalPeriod', u'dataTypeCD', u'opinionCD', u'expFactorCD', u'industryCategory', u'nIncome', u'assetsImpairLoss', u'da', u'faOgPbDepr', u'intanAssetsAmor', u'ltAmorExpAmor', u'finanExp', u'invLoss', u'fValueChgLoss', u'invenDecr', u'operReceiDecr', u'operPayaIncr', u'othOperA', u'amorExpDecr', u'accrExpIncr', u'dispFaOthLoss', u'faWritOff', u'deferTaDecr', u'deferTlIncr', u'other', u'specNocf1', u'anocf1', u'nCfOperateA', u'capitalExp', u'chgInvest', u'chgIntanAssets', u'othAssetsIcf', u'anicf', u'nCfFrInvestA', u'incrStDebt', u'incrLtDebt', u'incrMinorityInt', u'dividents', u'incrPic', u'othAssetsFcf', u'anfcf', u'nCfFrFinanA', u'forexEffects', u'ace', u'nChangeInCash', u'nCeBegBal', u'acei', u'nCeEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','expFactorCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FinfStmtIsInduGet(ticker = "", secID = "", endDate = "", beginDate = "", reportType = "", endExpDate = "", beginExpDate = "", expReportType = "", dataTypeCD = "", opinionCD = "", expFactorCD = "", industryCategory = "", field = "", pandas = "1"):
    """
    智能预测模型：一般工商业利润表,根据上市公司披露的财务报表，及宏观经济变化情况、行业景气程度、公司在行业中市场地位，自动生成乐观、中性、悲观三种财务数据预测结果
    
    :param ticker: 股票代码，如'000002',可以是列表,可空
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,可空
    :param endDate: 会计期间截止日期查询的截止日期,可空
    :param beginDate: 会计期间截止日期查询的起始日期,可空
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。,可以是列表,可空
    :param endExpDate: 预期根据会计期间截止日期查询的截止日期,可空
    :param beginExpDate: 预期根据会计期间截止日期查询的起始日期,可空
    :param expReportType: 预期根据报告类型。Q1-第一季报，Q2-第二季报（单季度），S1-半年报，Q3-第三季报（单季度），CQ3-三季报（累计1-9月），Q4-第四季报（单季度），A-年报。,可以是列表,可空
    :param dataTypeCD: 数据类型,可以是列表,可空
    :param opinionCD: 预测观点,可以是列表,可空
    :param expFactorCD: 预测因素,可以是列表,可空
    :param industryCategory: 行业分类,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFinfStmtIsIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endExpDate = endExpDate.strftime('%Y%m%d')
    except:
        endExpDate = endExpDate.replace('-', '')
    requestString.append("&endExpDate=%s"%(endExpDate))
    try:
        beginExpDate = beginExpDate.strftime('%Y%m%d')
    except:
        beginExpDate = beginExpDate.replace('-', '')
    requestString.append("&beginExpDate=%s"%(beginExpDate))
    requestString.append("&expReportType=")
    if hasattr(expReportType,'__iter__') and not isinstance(expReportType, str):
        if len(expReportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = expReportType
            requestString.append(None)
        else:
            requestString.append(','.join(expReportType))
    else:
        requestString.append(expReportType)
    requestString.append("&dataTypeCD=")
    if hasattr(dataTypeCD,'__iter__') and not isinstance(dataTypeCD, str):
        if len(dataTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dataTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(dataTypeCD))
    else:
        requestString.append(dataTypeCD)
    requestString.append("&opinionCD=")
    if hasattr(opinionCD,'__iter__') and not isinstance(opinionCD, str):
        if len(opinionCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = opinionCD
            requestString.append(None)
        else:
            requestString.append(','.join(opinionCD))
    else:
        requestString.append(opinionCD)
    requestString.append("&expFactorCD=")
    if hasattr(expFactorCD,'__iter__') and not isinstance(expFactorCD, str):
        if len(expFactorCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = expFactorCD
            requestString.append(None)
        else:
            requestString.append(','.join(expFactorCD))
    else:
        requestString.append(expFactorCD)
    requestString.append("&industryCategory=")
    if hasattr(industryCategory,'__iter__') and not isinstance(industryCategory, str):
        if len(industryCategory) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryCategory
            requestString.append(None)
        else:
            requestString.append(','.join(industryCategory))
    else:
        requestString.append(industryCategory)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FinfStmtIsInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FinfStmtIsInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secIDInt', u'ticker', u'secShortName', u'partyId', u'expEndDate', u'endDate', u'fiscalPeriod', u'dataTypeCD', u'opinionCD', u'expFactorCD', u'industryCategory', u'tRevenue', u'revenue', u'revenueYoy', u'othRevenueFin', u'intIncome', u'premEarned', u'commisIncome', u'specTor', u'ator', u'tCogs', u'cogs', u'grossMargin', u'bizTaxSurchg', u'bizTaxSurchgR', u'sellExp', u'sellExpR', u'adminExp', u'adminExpR', u'finanExp', u'finanExpR', u'nIntExp', u'intDebt', u'intExpRatio', u'assetsImpairLoss', u'othCogsFin', u'intExp', u'commisExp', u'premRefund', u'nCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'specToc', u'atoc', u'othOperP', u'fValueChgGain', u'investIncome', u'aJInvestIncome', u'forexGain', u'assetsDispGain', u'othIncome', u'othEffectOp', u'aeEffectOp', u'operateProfit', u'noperateIncome', u'noperateExp', u'ncaDisploss', u'aeEffectTp', u'tProfit', u'incomeTax', u'itTp', u'aeEffectNp', u'nIncome', u'npMargin', u'nIncomeAttrP', u'minorityGain', u'aeEffectNpp', u'totalShares', u'eps', u'basicEps', u'dilutedEps']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','expFactorCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FinfStmtSmmryGet(ticker = "", secID = "", endDate = "", beginDate = "", reportType = "", endExpDate = "", beginExpDate = "", expReportType = "", dataTypeCD = "", opinionCD = "", expFactorCD = "", industryCategory = "", field = "", pandas = "1"):
    """
    智能预测模型：财务摘要,根据上市公司披露的财务报表，及宏观经济变化情况、行业景气程度、公司在行业中市场地位，自动生成乐观、中性、悲观三种财务数据预测结果
    
    :param ticker: 股票代码，如'000002',可以是列表,可空
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,可空
    :param endDate: 会计期间截止日期查询的截止日期,可空
    :param beginDate: 会计期间截止日期查询的起始日期,可空
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。,可以是列表,可空
    :param endExpDate: 预期根据会计期间截止日期查询的截止日期,可空
    :param beginExpDate: 预期根据会计期间截止日期查询的起始日期,可空
    :param expReportType: 预期根据报告类型。Q1-第一季报，Q2-第二季报（单季度），S1-半年报，Q3-第三季报（单季度），CQ3-三季报（累计1-9月），Q4-第四季报（单季度），A-年报。,可以是列表,可空
    :param dataTypeCD: 数据类型,可以是列表,可空
    :param opinionCD: 预测观点,可以是列表,可空
    :param expFactorCD: 预测因素,可以是列表,可空
    :param industryCategory: 行业分类,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFinfStmtSmmry.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endExpDate = endExpDate.strftime('%Y%m%d')
    except:
        endExpDate = endExpDate.replace('-', '')
    requestString.append("&endExpDate=%s"%(endExpDate))
    try:
        beginExpDate = beginExpDate.strftime('%Y%m%d')
    except:
        beginExpDate = beginExpDate.replace('-', '')
    requestString.append("&beginExpDate=%s"%(beginExpDate))
    requestString.append("&expReportType=")
    if hasattr(expReportType,'__iter__') and not isinstance(expReportType, str):
        if len(expReportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = expReportType
            requestString.append(None)
        else:
            requestString.append(','.join(expReportType))
    else:
        requestString.append(expReportType)
    requestString.append("&dataTypeCD=")
    if hasattr(dataTypeCD,'__iter__') and not isinstance(dataTypeCD, str):
        if len(dataTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dataTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(dataTypeCD))
    else:
        requestString.append(dataTypeCD)
    requestString.append("&opinionCD=")
    if hasattr(opinionCD,'__iter__') and not isinstance(opinionCD, str):
        if len(opinionCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = opinionCD
            requestString.append(None)
        else:
            requestString.append(','.join(opinionCD))
    else:
        requestString.append(opinionCD)
    requestString.append("&expFactorCD=")
    if hasattr(expFactorCD,'__iter__') and not isinstance(expFactorCD, str):
        if len(expFactorCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = expFactorCD
            requestString.append(None)
        else:
            requestString.append(','.join(expFactorCD))
    else:
        requestString.append(expFactorCD)
    requestString.append("&industryCategory=")
    if hasattr(industryCategory,'__iter__') and not isinstance(industryCategory, str):
        if len(industryCategory) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryCategory
            requestString.append(None)
        else:
            requestString.append(','.join(industryCategory))
    else:
        requestString.append(industryCategory)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FinfStmtSmmryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FinfStmtSmmryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secIDInt', u'ticker', u'secShortName', u'partyId', u'expEndDate', u'endDate', u'fiscalPeriod', u'dataTypeCD', u'opinionCD', u'expFactorCD', u'industryCategory', u'revenue', u'revenueYoy', u'operateProfit', u'operProfitYoy', u'ebitda', u'ebitdaYoy', u'ebit', u'ebitYoy', u'nIncome', u'niYoy', u'nIncomeAttrP', u'niAttrPYoy', u'grossMargin', u'npMargin', u'ROE', u'EPS', u'PE', u'PB']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','expFactorCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RpIndustryItemGet(itemID = "", itemName = "", tableID = "", tableName = "", field = "", pandas = "1"):
    """
    获取行业项目数据名称、对应字段、对应表与视图信息等。
    
    :param itemID: 项目代码,可以是列表,itemID、itemName、tableID、tableName至少选择一个
    :param itemName: 项目名称，支持模糊查询,itemID、itemName、tableID、tableName至少选择一个
    :param tableID: 项目所在表代码,可以是列表,itemID、itemName、tableID、tableName至少选择一个
    :param tableName: 项目表名，支持模糊查询,itemID、itemName、tableID、tableName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRpIndustryItem.csv?ispandas=1&') 
    requestString.append("itemID=")
    if hasattr(itemID,'__iter__') and not isinstance(itemID, str):
        if len(itemID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemID
            requestString.append(None)
        else:
            requestString.append(','.join(itemID))
    else:
        requestString.append(itemID)
    if not isinstance(itemName, str) and not isinstance(itemName, unicode):
        itemName = str(itemName)

    requestString.append("&itemName=%s"%(itemName))
    requestString.append("&tableID=")
    if hasattr(tableID,'__iter__') and not isinstance(tableID, str):
        if len(tableID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tableID
            requestString.append(None)
        else:
            requestString.append(','.join(tableID))
    else:
        requestString.append(tableID)
    if not isinstance(tableName, str) and not isinstance(tableName, unicode):
        tableName = str(tableName)

    requestString.append("&tableName=%s"%(tableName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RpIndustryItemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RpIndustryItemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'itemID', u'itemName', u'itemColumn', u'position', u'tableID', u'tableName', u'tableComment', u'stmtName', u'stmtVwName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'itemID': 'str','itemName': 'str','itemColumn': 'str','tableID': 'str','tableName': 'str','tableComment': 'str','stmtName': 'str','stmtVwName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RpIndustryDataGet(itemID = "", typeID = "", beginDate = "", calType = "", dimensionTime = "", enFrequency = "", endDate = "", reportType = "", field = "", pandas = "1"):
    """
    获取行业项目具体数值以及计算口径、频率、时间维度等信息。
    
    :param itemID: 项目代码,可以是列表,itemID、typeID、beginDate至少选择一个
    :param typeID: 分类代码,可以是列表,itemID、typeID、beginDate至少选择一个
    :param beginDate: 起始日期,itemID、typeID、beginDate至少选择一个
    :param calType: 计算口径，通过DataAPI.SysCodeGet输入codeTypeID=71009获取,可以是列表,可空
    :param dimensionTime: 时间维度，通过DataAPI.SysCodeGet输入codeTypeID=71007获取,可以是列表,可空
    :param enFrequency: 频率，通过DataAPI.SysCodeGet输入codeTypeID=71008获取,可以是列表,可空
    :param endDate: 截止日期,可空
    :param reportType: 财务指标类型。Q1-第一季报，Q2-第二季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），Q4-第四季报，A-年报，A1-一季度TTM，A2-二季度TTM，A3-三季度TTM。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getRpIndustryData.csv?ispandas=1&') 
    requestString.append("itemID=")
    if hasattr(itemID,'__iter__') and not isinstance(itemID, str):
        if len(itemID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemID
            requestString.append(None)
        else:
            requestString.append(','.join(itemID))
    else:
        requestString.append(itemID)
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&calType=")
    if hasattr(calType,'__iter__') and not isinstance(calType, str):
        if len(calType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = calType
            requestString.append(None)
        else:
            requestString.append(','.join(calType))
    else:
        requestString.append(calType)
    requestString.append("&dimensionTime=")
    if hasattr(dimensionTime,'__iter__') and not isinstance(dimensionTime, str):
        if len(dimensionTime) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dimensionTime
            requestString.append(None)
        else:
            requestString.append(','.join(dimensionTime))
    else:
        requestString.append(dimensionTime)
    requestString.append("&enFrequency=")
    if hasattr(enFrequency,'__iter__') and not isinstance(enFrequency, str):
        if len(enFrequency) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = enFrequency
            requestString.append(None)
        else:
            requestString.append(','.join(enFrequency))
    else:
        requestString.append(enFrequency)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RpIndustryDataGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RpIndustryDataGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'date', u'itemID', u'typeID', u'calType', u'dimensionTime', u'enFrequency', u'value', u'updateTime', u'reportType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'itemID': 'str','typeID': 'str','dimensionTime': 'str','enFrequency': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并资产负债表模板，收集了2007年以来沪深上市公司定期报告中各个会计期间的资产负债表数据； 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBS.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'settProv', u'loanToOthBankFi', u'tradingFA', u'NotesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'inventories', u'NCAWithin1Y', u'othCA', u'TCA', u'disburLA', u'availForSaleFa', u'htmInvest', u'LTReceive', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'TNCA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'NotesPayable', u'AP', u'advanceReceipts', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'NCLWithin1Y', u'othCL', u'TCL', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'LTPayable', u'specificPayables', u'estimatedLiab', u'deferTaxLiab', u'othNCL', u'TNCL', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSBankGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
     1、根据2007年新会计准则制定的银行业资产负债表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的资产负债表数据；（主要是银行业上市公司） 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSBank.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSBankGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSBankGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'loanToOthBankFi', u'tradingFA', u'intReceiv', u'purResaleFa', u'disburLA', u'availForSaleFA', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'intanAssets', u'goodwill', u'deferTaxAssets', u'CReserCB', u'deposInOthBfi', u'preciMetals', u'derivAssets', u'finanLeaseReceiv', u'investAsReceiv', u'othAssets', u'AE', u'AA', u'TAssets', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'payrollPayable', u'taxesPayable', u'intPayable', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'estimatedLiab', u'deferTaxLiab', u'deposFrOthBfi', u'derivLiab', u'othLiab', u'LE', u'LA', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSE', u'othEffectSA', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSSecuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业资产负债表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的资产负债表数据；（主要是证券业上市公司） 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSSecu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSSecuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSSecuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'clientDepos', u'settProv', u'clientProv', u'loanToOthBankFi', u'tradingFA', u'intReceiv', u'purResaleFa', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'intanAssets', u'transacSeatFee', u'deferTaxAssets', u'derivAssets', u'refundDepos', u'othAssets', u'AE', u'AA', u'TAssets', u'STBorr', u'pledgeBorr', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'payrollPayable', u'taxesPayable', u'intPayable', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'estimatedLiab', u'deferTaxLiab', u'derivLiab', u'othLiab', u'LE', u'LA', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'transacRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSE', u'othEffectSA', u'TShEquity', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSInduGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业资产负债表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的资产负债表数据；（主要是一般工商业上市公司） 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'settProv', u'loanToOthBankFi', u'tradingFA', u'derivAssets', u'NotesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'inventories', u'assetsHeldForSale', u'NCAWithin1Y', u'othCA', u'CAE', u'CAA', u'TCA', u'disburLA', u'availForSaleFa', u'htmInvest', u'LTReceive', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'NCAE', u'NCAA', u'TNCA', u'AE', u'AA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'derivLiab', u'NotesPayable', u'AP', u'advanceReceipts', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'liabHeldForSale', u'NCLWithin1Y', u'accruedExp', u'othCL', u'CLE', u'CLA', u'TCL', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'LTPayable', u'LTPayrollPayable', u'specificPayables', u'estimatedLiab', u'deferRevenue', u'deferTaxLiab', u'othNCL', u'NCLE', u'NCLA', u'TNCL', u'LE', u'LA', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSE', u'othEffectSA', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSInsuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业资产负债表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的资产负债表数据；（主要是保险业上市公司） 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元。 5、每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSInsu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSInsuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSInsuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'loanToOthBankFi', u'tradingFA', u'premiumReceiv', u'reinsurReceiv', u'intReceiv', u'purResaleFa', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'intanAssets', u'deferTaxAssets', u'derivAssets', u'subrogRecoReceiv', u'RRReinsUnePrem', u'RRReinsOutstdCla', u'RRReinsLinsLiab', u'RRReinsLThinsLiab', u'PHPledgeLoans', u'fixedTermDepos', u'refundCapDepos', u'indepAccAssets', u'othAssets', u'AE', u'AA', u'TAssets', u'STBorr', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'reinsurPayable', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'deferTaxLiab', u'derivLiab', u'premReceivAdva', u'indemAccPayable', u'policyDivPayable', u'PHInvest', u'reserUnePrem', u'reserOutstdClaims', u'reserLinsLiab', u'reserLthinsLiab', u'indeptAccLiab', u'othLiab', u'LE', u'LA', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'SEE', u'SEA', u'TEquityAttrP', u'minorityInt', u'othEffectSE', u'othEffectSA', u'TShEquity', u'LEE', u'LEA', u'TLiabEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并现金流量表模板，收集了2007年以来沪深上市公司定期报告中各个会计期间的现金流量表数据； 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCF.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFBankGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据；（主要是银行业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元；5、每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFBank.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFBankGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFBankGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'specOCIF', u'AOCIF', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'specOCOF', u'AOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'specICIF', u'AICIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'specICOF', u'AICOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'specFCIF', u'AFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'specFCOF', u'AFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'othEffectCE', u'ACE', u'NChangeInCash', u'NCEBegBal', u'othEffectCEI', u'ACEI', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFSecuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据；（主要是证券业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元；5、每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG ',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFSecu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFSecuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFSecuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'specOCIF', u'AOCIF', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'specOCOF', u'AOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'specICIF', u'AICIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'specICOF', u'AICOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'specFCIF', u'AFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'specFCOF', u'AFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'othEffectCE', u'ACE', u'NChangeInCash', u'NCEBegBal', u'othEffectCEI', u'ACEI', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInduGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据；（主要是一般工商业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'specOCIF', u'AOCIF', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'specOCOF', u'AOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'specICIF', u'AICIF', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'specICOF', u'AICOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'specFCIF', u'AFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'specFCOF', u'AFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'othEffectCE', u'ACE', u'NChangeInCash', u'NCEBegBal', u'othEffectCEI', u'ACEI', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInsuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据；（主要是保险业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInsu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInsuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInsuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'specOCIF', u'AOCIF', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'specOCOF', u'AOCOF', u'COutfOperateA', u'ANOCF', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'specICIF', u'AICIF', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'specICOF', u'AICOF', u'COutfFrInvestA', u'ANICF', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'specFCIF', u'AFCIF', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'specFCOF', u'AFCOF', u'COutfFrFinanA', u'ANFCF', u'NCFFrFinanA', u'forexEffects', u'othEffectCE', u'ACE', u'NChangeInCash', u'NCEBegBal', u'othEffectCEI', u'ACEI', u'NCEEndBal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并利润表模板，收集了2007年以来沪深上市公司定期报告中各个会计期间的利润表数据； 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIS.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISBankGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据；（主要是银行业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新。
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISBank.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISBankGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISBankGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'othOperRev', u'specOR', u'AOR', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'specOC', u'AOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othEffectNPP', u'AEEffectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCI', u'AEEffectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPCI', u'AEEffectPCI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISSecuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据；（主要是证券业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISSecu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    if not isinstance(fiscalPeriod, str) and not isinstance(fiscalPeriod, unicode):
        fiscalPeriod = str(fiscalPeriod)

    requestString.append("&fiscalPeriod=%s"%(fiscalPeriod))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISSecuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISSecuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'NIntIncome', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'othOperRev', u'specOR', u'AOR', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'specOC', u'AOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othEffectNPP', u'AEEffectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCI', u'AEEffectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPCI', u'AEEffectPCI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInduGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据；（主要是一般工商业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISIndu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    if not isinstance(fiscalPeriod, str) and not isinstance(fiscalPeriod, unicode):
        fiscalPeriod = str(fiscalPeriod)

    requestString.append("&fiscalPeriod=%s"%(fiscalPeriod))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'specTOR', u'ATOR', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'specTOC', u'ATOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'NIncomeBMA', u'minorityGain', u'othEffectNPP', u'AEEffectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCI', u'AEEffectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPCI', u'AEEffectPCI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInsuGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", endDateRep = "", beginDateRep = "", beginYear = "", endYear = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据；（主要是保险业上市公司） 2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新。
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDateRep: 报表会计期末，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDateRep: 报表会计期末，起始时间，输入格式“YYYYMMDD”,可空
    :param beginYear: 年度，起始时间，输入格式"YYYY",可空
    :param endYear: 年度，结束时间，输入格式"YYYY",可空
    :param fiscalPeriod: 会计期间长度，3，6，9，12,可多值输入,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInsu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    try:
        endDateRep = endDateRep.strftime('%Y%m%d')
    except:
        endDateRep = endDateRep.replace('-', '')
    requestString.append("&endDateRep=%s"%(endDateRep))
    try:
        beginDateRep = beginDateRep.strftime('%Y%m%d')
    except:
        beginDateRep = beginDateRep.replace('-', '')
    requestString.append("&beginDateRep=%s"%(beginDateRep))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    if not isinstance(fiscalPeriod, str) and not isinstance(fiscalPeriod, unicode):
        fiscalPeriod = str(fiscalPeriod)

    requestString.append("&fiscalPeriod=%s"%(fiscalPeriod))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInsuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInsuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'commisExp', u'othOperRev', u'specOR', u'AOR', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'genlAdminExp', u'reinsCostRefund', u'assetsImpairLoss', u'othOperCosts', u'specOC', u'AOC', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othEffectOP', u'aeEffectOp', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'othEffectTP', u'AEEffectTP', u'TProfit', u'incomeTax', u'othEffectNP', u'AEEffectNP', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othEffectNPP', u'AEEffectNPP', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'othEffectCI', u'AEEffectCI', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'othEffectPCI', u'AEEffectPCI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtEeGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", field = "", pandas = "1"):
    """
    获取2007年及以后年度上市公司披露的业绩快报中的主要财务指标等其他数据，包括本期，去年同期，及本期与期初数值同比数据。每季证券交易所披露相关公告时更新数据，公司ipo时发布相关信息也会同时更新。上市公司每次修正数据，新增数据并保留原有修正前数据。
    
    :param ticker: 股票交易代码，如'600000',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600000.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtEe.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtEeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtEeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'primeOperRev', u'grossProfit', u'operateProfit', u'TProfit', u'NIncomeAttrP', u'NIncomeCut', u'NCfOperA', u'basicEPS', u'EPSW', u'EPSCut', u'EPSCutW', u'ROE', u'ROEW', u'ROECut', u'ROECutW', u'NCfOperAPs', u'TAssets', u'TEquityAttrP', u'paidInCapital', u'NAssetPS', u'revenueLY', u'primeOperRevLY', u'grossProfitLY', u'operProfitLY', u'TProfitLY', u'NIncomeAttrPLY', u'NIncomeCutLY', u'NCfOperALY', u'basicEPSLY', u'EPSWLY', u'EPSCutLY', u'EPSCutWLY', u'ROELY', u'ROEWLY', u'ROECutLY', u'ROECutWLY', u'NCfOperAPsLY', u'TAssetsLY', u'TEquityAttrPLY', u'NAssetPsLY', u'revenueYOY', u'primeOperRevYOY', u'grossProfitYOY', u'operProfitYOY', u'TProfitYOY', u'NIncomeAttrPYOY', u'NIncomeCutYOY', u'NCFOperAYOY', u'basicEPSYOY', u'EPSWYOY', u'EPSCutYOY', u'EPSCutWYOY', u'ROEYOY', u'ROEWYOY', u'ROECutYOY', u'ROECutWYOY', u'NCfOperAPsYOY', u'TAssetsYOY', u'TEquityAttrPYOY', u'NAssetPsYOY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtEfGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", forecastType = "", field = "", pandas = "1"):
    """
    1、获取2007年及以后年度上市公司披露的公告中的预期下一报告期收入、净利润、归属于母公司净利润、基本每股收益及其幅度变化数据。 2、上市公司对经营成果科目的预计情况数据一般为其上限与下限，上限取值为公告中披露该科目中绝对值较大值，下限取值为公告中披露该科目中绝对值较小值。 3、数值为"正"代表该公司预计盈利，数值为"负"代表该公司预计亏损。若上下限"正"、"负"符号不同，代表该公司盈利亏损情况尚不确定。 4、业绩预期类型以公告中文字披露预期类型为准，若公告中未有文字披露预期类型，则根据数据情况判断预期类型。 5、每季证券交易所披露相关公告时更新数据，公司ipo时发布相关信息也会同时更新。上市公司每次修正数据，新增数据并保留原有修正前数据（含科创板）。
    
    :param ticker: 股票交易代码，如'000005',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000005.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param publishDateEnd: 证券交易所披露的信息发布日期，结束时间，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期，起始时间，输入格式“YYYYMMDD”,可空
    :param forecastType: 业绩预期类型。对应DataAPI.SysCodeGet.codeTypeID=70006。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtEf.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    if not isinstance(forecastType, str) and not isinstance(forecastType, unicode):
        forecastType = str(forecastType)

    requestString.append("&forecastType=%s"%(forecastType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtEfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtEfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'forecastType', u'revChgrLL', u'revChgrUPL', u'expRevLL', u'expRevUPL', u'NIncomeChgrLL', u'NIncomeChgrUPL', u'expnIncomeLL', u'expnIncomeUPL', u'NIncAPChgrLL', u'NIncAPChgrUPL', u'expnIncAPLL', u'expnIncAPUPL', u'expEPSLL', u'expEPSUPL', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并资产负债表模板，收集了2007年以来沪深上市公司定期报告中各个会计期间的资产负债表数据； 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据。 4、本表中单位为人民币元； 5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'settProv', u'loanToOthBankFi', u'tradingFA', u'NotesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'inventories', u'NCAWithin1Y', u'othCA', u'TCA', u'disburLA', u'availForSaleFa', u'htmInvest', u'LTReceive', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'TNCA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'NotesPayable', u'AP', u'advanceReceipts', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'NCLWithin1Y', u'othCL', u'TCL', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'LTPayable', u'specificPayables', u'estimatedLiab', u'deferTaxLiab', u'othNCL', u'TNCL', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity', u'deferRevenue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSBankAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业资产负债表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的资产负债表数据；（主要是银行业上市公司） 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据。； 4、本表中单位为人民币元； 5、每季更新
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSBankAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSBankAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSBankAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'loanToOthBankFi', u'tradingFA', u'intReceiv', u'purResaleFa', u'disburLA', u'availForSaleFA', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'intanAssets', u'goodwill', u'deferTaxAssets', u'CReserCB', u'deposInOthBfi', u'preciMetals', u'derivAssets', u'finanLeaseReceiv', u'investAsReceiv', u'othAssets', u'TAssets', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'payrollPayable', u'taxesPayable', u'intPayable', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'estimatedLiab', u'deferTaxLiab', u'deposFrOthBfi', u'derivLiab', u'othLiab', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSSecuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业资产负债表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的资产负债表数据；（主要是证券业上市公司） 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，均有采集并对外展示； 4、本表中单位为人民币元； 5、每季更新； 6、收录每一会计期间最新披露的财务数据。
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSSecuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSSecuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSSecuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'clientDepos', u'settProv', u'clientProv', u'loanToOthBankFi', u'tradingFA', u'intReceiv', u'purResaleFa', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'intanAssets', u'transacSeatFee', u'deferTaxAssets', u'derivAssets', u'refundDepos', u'othAssets', u'TAssets', u'STBorr', u'pledgeBorr', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'payrollPayable', u'taxesPayable', u'intPayable', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'estimatedLiab', u'deferTaxLiab', u'derivLiab', u'othLiab', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'transacRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSInduAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业资产负债表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的资产负债表数据；（主要是一般工商业上市公司） 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据； 4、本表中单位为人民币元； 5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSInduAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSInduAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSInduAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'settProv', u'loanToOthBankFi', u'tradingFA', u'derivAssets', u'NotesReceiv', u'AR', u'prepayment', u'premiumReceiv', u'reinsurReceiv', u'reinsurReserReceiv', u'intReceiv', u'divReceiv', u'othReceiv', u'purResaleFa', u'inventories', u'assetsHeldForSale', u'NCAWithin1Y', u'othCA', u'TCA', u'disburLA', u'availForSaleFa', u'htmInvest', u'LTReceive', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'CIP', u'constMaterials', u'fixedAssetsDisp', u'producBiolAssets', u'oilAndGasAssets', u'intanAssets', u'RD', u'goodwill', u'LTAmorExp', u'deferTaxAssets', u'othNCA', u'TNCA', u'TAssets', u'STBorr', u'CBBorr', u'depos', u'loanFrOthBankFi', u'tradingFL', u'derivLiab', u'NotesPayable', u'AP', u'advanceReceipts', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'intPayable', u'divPayable', u'othPayable', u'reinsurPayable', u'insurReser', u'fundsSecTradAgen', u'fundsSecUndwAgen', u'liabHeldForSale', u'NCLWithin1Y', u'accruedExp', u'othCL', u'TCL', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'LTPayable', u'LTPayrollPayable', u'specificPayables', u'estimatedLiab', u'deferRevenue', u'deferTaxLiab', u'othNCL', u'TNCL', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'specialReser', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtBSInsuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业资产负债表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的资产负债表数据；（主要是保险业上市公司） 2、仅收集合并报表数据，包括期末和期初数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据； 4、本表中单位为人民币元； 5、每季更新
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-一季度，S1-半年度，Q3-三季度，A-年度。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtBSInsuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtBSInsuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtBSInsuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'cashCEquiv', u'loanToOthBankFi', u'tradingFA', u'premiumReceiv', u'reinsurReceiv', u'intReceiv', u'purResaleFa', u'availForSaleFa', u'htmInvest', u'LTEquityInvest', u'investRealEstate', u'fixedAssets', u'intanAssets', u'deferTaxAssets', u'derivAssets', u'subrogRecoReceiv', u'RRReinsUnePrem', u'RRReinsOutstdCla', u'RRReinsLinsLiab', u'RRReinsLThinsLiab', u'PHPledgeLoans', u'fixedTermDepos', u'refundCapDepos', u'indepAccAssets', u'othAssets', u'TAssets', u'STBorr', u'loanFrOthBankFi', u'tradingFL', u'soldForRepurFa', u'commisPayable', u'payrollPayable', u'taxesPayable', u'reinsurPayable', u'LTBorr', u'bondPayable', u'preferredStockL', u'perpetualBondL', u'deferTaxLiab', u'derivLiab', u'premReceivAdva', u'indemAccPayable', u'policyDivPayable', u'PHInvest', u'reserUnePrem', u'reserOutstdClaims', u'reserLinsLiab', u'reserLthinsLiab', u'indeptAccLiab', u'othLiab', u'TLiab', u'paidInCapital', u'othEquityInstr', u'preferredStockE', u'perpetualBondE', u'capitalReser', u'treasuryShare', u'othCompreIncome', u'surplusReser', u'ordinRiskReser', u'retainedEarnings', u'forexDiffer', u'TEquityAttrP', u'minorityInt', u'TShEquity', u'TLiabEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtEeAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    1、获取2007年及以后年度上市公司披露的业绩快报中的主要财务指标等其他数据，包括本期，去年同期，及本期与期初数值同比数据。 2、收录每一会计期间最新披露的财务数据。
    
    :param ticker: 股票交易代码，如'600000',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600000.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtEeAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtEeAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtEeAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'primeOperRev', u'grossProfit', u'operateProfit', u'TProfit', u'NIncomeAttrP', u'NIncomeCut', u'NCfOperA', u'basicEPS', u'EPSW', u'EPSCut', u'EPSCutW', u'ROE', u'ROEW', u'ROECut', u'ROECutW', u'NCfOperAPs', u'TAssets', u'TEquityAttrP', u'paidInCapital', u'NAssetPS', u'revenueLY', u'primeOperRevLY', u'grossProfitLY', u'operProfitLY', u'TProfitLY', u'NIncomeAttrPLY', u'NIncomeCutLY', u'NCfOperALY', u'basicEPSLY', u'EPSWLY', u'EPSCutLY', u'EPSCutWLY', u'ROELY', u'ROEWLY', u'ROECutLY', u'ROECutWLY', u'NCfOperAPsLY', u'TAssetsLY', u'TEquityAttrPLY', u'NAssetPsLY', u'revenueYOY', u'primeOperRevYOY', u'grossProfitYOY', u'operProfitYOY', u'TProfitYOY', u'NIncomeAttrPYOY', u'NIncomeCutYOY', u'NCFOperAYOY', u'basicEPSYOY', u'EPSWYOY', u'EPSCutYOY', u'EPSCutWYOY', u'ROEYOY', u'ROEWYOY', u'ROECutYOY', u'ROECutWYOY', u'NCfOperAPsYOY', u'TAssetsYOY', u'TEquityAttrPYOY', u'NAssetPsYOY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并现金流量表模板，收集了2007年以来沪深上市公司定期报告中各个会计期间的现金流量表数据；2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFBankAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据（主要是银行业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFBankAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFBankAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFBankAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFSecuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据（主要是证券业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG ',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFSecuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFSecuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFSecuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInduAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据（主要是一般工商业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInduAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInduAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInduAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInsuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业现金流量表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的现金流量表数据（主要是保险业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInsuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInsuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInsuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的合并利润表模板，收集了2007年以来沪深上市公司定期报告中各个会计期间的利润表数据；2、仅收集合并报表数据，包括本期和上期数据； 3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISBankAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的银行业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据（主要是银行业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000001.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISBankAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISBankAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISBankAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS', u'specOR', u'AOR']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISSecuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的证券业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据（主要是证券业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新
    
    :param ticker: 股票代码，如'600369',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'600369.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISSecuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISSecuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISSecuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'NIntIncome', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInduAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的一般工商业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据（主要是一般工商业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000002.XSHE',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInduAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInduAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInduAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'tRevenue', u'revenue', u'intIncome', u'intExp', u'premEarned', u'commisIncome', u'commisExp', u'TCogs', u'COGS', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInsuAllLatestGet(ticker = "", secID = "", reportType = "", endDate = "", beginDate = "", year = "", field = "", pandas = "1"):
    """
    1、根据2007年新会计准则制定的保险业利润表模板，收集了2007年以来沪深上市公司定期报告中所有以此模板披露的利润表数据（主要是保险业上市公司）；2、仅收集合并报表数据，包括本期和上期数据；3、如果上市公司对外财务报表进行更正，调整，收录每一会计期间最新披露的财务数据；4、本表中单位为人民币元；5、每季更新
    
    :param ticker: 股票代码，如'601318',可以是列表,ticker、secID、reportType至少选择一个
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'601318.XSHG',可以是列表,ticker、secID、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,可空
    :param year: 年度，会计期间所在年度,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInsuAllLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&year=")
    if hasattr(year,'__iter__') and not isinstance(year, str):
        if len(year) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = year
            requestString.append(None)
        else:
            requestString.append(','.join(year))
    else:
        requestString.append(year)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInsuAllLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInsuAllLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'endDate', u'endDateRep', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'mergedFlag', u'reportType', u'fiscalPeriod', u'accoutingStandards', u'currencyCD', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'commisExp', u'othOperRev', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'genlAdminExp', u'reinsCostRefund', u'assetsImpairLoss', u'othOperCosts', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'basicEPS', u'dilutedEPS', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str','mergedFlag': 'str','reportType': 'str','fiscalPeriod': 'str','accoutingStandards': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtDerGet(secID = "", ticker = "", beginYear = "", endYear = "", reportType = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的衍生数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元
    
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'00011.XHKG',可以是列表,secID、ticker、beginYear、endYear、reportType至少选择一个
    :param ticker: 交易代码,如'00011',可以是列表,secID、ticker、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",secID、ticker、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",secID、ticker、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,secID、ticker、beginYear、endYear、reportType至少选择一个
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMM”,可空
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMM”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtDer.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtDerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtDerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'exchangeCD', u'secShortName', u'endDate', u'tFixedAssets', u'intFreeCl', u'intFreeNcl', u'intCl', u'intDebt', u'nDebt', u'nTanAssets', u'workCapital', u'nWorkCapital', u'IC', u'tRe', u'grossProfit', u'opaProfit', u'valChgProfit', u'nIntExp', u'EBIT', u'EBITDA', u'EBIAT', u'nrProfitLoss', u'niAttrPCut', u'FCFF', u'FCFE', u'DA']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIsFinexpPSGet(ticker = "", beginDate = "", endDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    年报及半年报中披露的利润表中科目财务费用附注明细（含科创板）。
    
    :param ticker: 股票代码，如'000002',可以是列表,ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMM”,ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMM”,ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIsFinexpPS.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIsFinexpPSGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIsFinexpPSGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'infoSource', u'intExp', u'intExpCAPital', u'intIncome', u'intExpDisc', u'intIncomeDisc', u'NIntExp', u'FOccuExp', u'FOccuIncome', u'forexLoss', u'forexLossCAPital', u'forexGain', u'forexNLoss', u'CDiscount', u'commission', u'secuExp', u'othFinExp', u'othFinIncome', u'finExp']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','infoSource': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCfsGet(secID = "", ticker = "", beginDate = "", endDate = "", beginYear = "", endYear = "", reportType = "", fiscalPeriod = "", field = "", pandas = "1"):
    """
    上市公司披露根据间接法编制经营活动现金流的现金流量表补充资料（仅有合并报表数据，含科创板）。
    
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'00011.XHKG',可以是列表,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param ticker: 股票代码,可以是列表,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMM”,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMM”,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 会计年度，起始时间，输入格式“YYYY”,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 会计年度，结束时间，输入格式“YYYY”,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，Q3-第三季报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param fiscalPeriod: 会计期间,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCfs.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&fiscalPeriod=")
    if hasattr(fiscalPeriod,'__iter__') and not isinstance(fiscalPeriod, str):
        if len(fiscalPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fiscalPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(fiscalPeriod))
    else:
        requestString.append(fiscalPeriod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCfsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCfsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'endDateRep', u'reportType', u'fiscalPeriod', u'mergedFlag', u'accoutingStandARds', u'currencyCD', u'NIncome', u'assetsImpairLoss', u'FAOGPBDepr', u'intanAssetsAmor', u'LTAmorExpAmor', u'amorExpDecr', u'accrExpIncr', u'dispFaOthLoss', u'FAWritOff', u'FValueChgLoss', u'finanExp', u'invLoss', u'deferTaDecr', u'deferTlIncr', u'invenDecr', u'operReceiDecr', u'operPayaIncr', u'other', u'specNOCF1', u'ANOCF1', u'NCFOperateANotes', u'contrANOCF', u'convDebtCAPi', u'convBonds1Y', u'finanLeaFA', u'CEndBal', u'CBegBal', u'CEEndBal', u'CEBegBal', u'specC', u'AC', u'NChangeInCash', u'contrANC']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','reportType': 'str','mergedFlag': 'str','accoutingStandARds': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiPSGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标： 1、计算依据为该公司该期间最新一次披露的财务数据 2、计算起始期间为'2007-03-31' 3、单位：人民币元 4、除基本每股收益、稀释每股收益取原报表披露值以外，其余指标均为计算获得，计算公式：科目/期末总股份数量（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiPS.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiPSGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiPSGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'EPS', u'basicEPS', u'dilutedEPS', u'nAssetPS', u'tRevPS', u'revPS', u'opPS', u'EBITPS', u'cReserPS', u'sReserPS', u'reserPS', u'rePS', u'tRePS', u'nCfOperAPS', u'nCInCashPS', u'FCFFPS', u'FCFEPS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiGrowthGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2008-03-31'3、单位：人民币元4、利润表及现金流量表同比增长率计算公式：（本期-上年同期）/|上年同期|5、资产负债表同比增长率计算公式：（期末-期初）/|期初|（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiGrowth.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiGrowthGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiGrowthGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tRevenueYOY', u'revenueYOY', u'operProfitYOY', u'tProfitYOY', u'niYOY', u'niAttrPYOY', u'niAttrPCutYOY', u'basicEPSYOY', u'dilutedEPSYOY', u'ROEYOY', u'nCfOpaYOY', u'nCfOpaPSYOY', u'taYTD', u'naYTD', u'teAttrPYTD', u'naPSYTD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiRtnGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiRtn.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiRtnGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiRtnGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'grossMARgin', u'npMARgin', u'ROE', u'ROEA', u'ROEW', u'ROECut', u'ROECutW', u'ROA', u'ROAEBIT', u'ROIC']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiTrnovrGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2008-03-31'3、单位：人民币元4、仅对一般工商业公司进行计算（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiTrnovr.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiTrnovrGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiTrnovrGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'faTurnover', u'tfaTurnover', u'caTurnover', u'taTurnover', u'invenTurnover', u'daysInven', u'ARTurnover', u'daysAR', u'operCycle', u'APTurnover', u'daysAP']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtDerPitGet(secID = "", ticker = "", beginDate = "", endDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的衍生数据（含科创板）： 1、对计算依据共同改变的数据，每改变一次，新增计算结果，根据ACT_PUBTIME字段可以确定数据来源的实际发布时间； 2、计算起始期间为'2007-03-31' ；3、单位：人民币元。
    
    :param secID: 证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到,如'000011.XSHE',可以是列表,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param ticker: 交易代码,如'000011',可以是列表,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 会计期间截止日期，起始时间，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 会计期间截止日期，结束时间，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,secID、ticker、beginDate、endDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtDerPit.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtDerPitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtDerPitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'exchangeCD', u'secShortName', u'publishDate', u'actPubtime', u'endDate', u'tFixedAssets', u'intFreeCl', u'intFreeNcl', u'intCl', u'intDebt', u'nDebt', u'nTanAssets', u'workCapital', u'nWorkCapital', u'IC', u'tRe', u'grossProfit', u'opaProfit', u'valChgProfit', u'nIntExp', u'EBIT', u'EBITDA', u'EBIAT', u'nrProfitLoss', u'niAttrPCut', u'FCFF', u'FCFE', u'DA']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','actPubtime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiPSPitGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）： 1、对计算依据共同改变的数据，每改变一次，新增计算结果，根据ACT_PUBTIME字段可以确定数据来源的实际发布时间；  2、计算起始期间为'2007-03-31'； 3、单位：人民币元；4、除基本每股收益、稀释每股收益取原报表披露值以外，其余指标均为计算获得，计算公式：科目/期末总股份数量。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiPSPit.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiPSPitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiPSPitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'actPubtime', u'EPS', u'basicEPS', u'dilutedEPS', u'nAssetPS', u'tRevPS', u'revPS', u'opPS', u'EBITPS', u'cReserPS', u'sReserPS', u'reserPS', u'rePS', u'tRePS', u'nCfOperAPS', u'nCInCashPS', u'FCFFPS', u'FCFEPS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiGrowthPitGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）： 1、对计算依据共同改变的数据，每改变一次，新增计算结果，根据ACT_PUBTIME字段可以确定数据来源的实际发布时间； 2、计算起始期间为'2008-03-31' ；3、单位：人民币元；4、利润表及现金流量表同比增长率计算公式：（本期-上年同期）/|上年同期| 5、资产负债表同比增长率计算公式：（期末-期初）/|期初|。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiGrowthPit.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiGrowthPitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiGrowthPitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'actPubtime', u'tRevenueYOY', u'revenueYOY', u'operProfitYOY', u'tProfitYOY', u'niYOY', u'niAttrPYOY', u'niAttrPCutYOY', u'basicEPSYOY', u'dilutedEPSYOY', u'ROEYOY', u'nCfOpaYOY', u'nCfOpaPSYOY', u'taYTD', u'naYTD', u'teAttrPYTD', u'naPSYTD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiRtnPitGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）： 1、对计算依据共同改变的数据，每改变一次，新增计算结果，根据ACT_PUBTIME字段可以确定数据来源的实际发布时间； 2、计算起始期间为'2007-03-31' ；3、单位：人民币元。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiRtnPit.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiRtnPitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiRtnPitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'actPubtime', u'grossMARgin', u'npMARgin', u'ROE', u'ROEA', u'ROEW', u'ROECut', u'ROECutW', u'ROA', u'ROAEBIT', u'ROIC']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiTrnovrPitGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）： 1、对计算依据共同改变的数据，每改变一次，新增计算结果，根据ACT_PUBTIME字段可以确定数据来源的实际发布时间； 2、计算起始期间为'2008-03-31'； 3、单位：人民币元。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiTrnovrPit.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiTrnovrPitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiTrnovrPitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'actPubtime', u'faTurnover', u'tfaTurnover', u'caTurnover', u'taTurnover', u'invenTurnover', u'daysInven', u'ARTurnover', u'daysAR', u'operCycle', u'APTurnover', u'daysAP']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actPubtime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiLqdGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标：1、计算依据为该公司该期间最新一次披露的财务数据； 2、计算起始期间为'2007-03-31'；3、单位：人民币元；4、部分科目仅对一般工商业公司进行计算（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiLqd.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiLqdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiLqdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'currenTRatio', u'quickRatio', u'squickRatio', u'opCL', u'opTL', u'asseTLiabRatio', u'equityRatio', u'TLTeap', u'teapTL', u'teapID', u'nTanATL', u'nTanAID', u'nTanANd', u'EBITDATL', u'EBITDAID', u'cashICL', u'cashCL', u'nCFOpaCL', u'nCFOpaLiab', u'nCFOpaID', u'nCFOpaNd', u'nCFOpaNCL', u'nCFNfaCL', u'nCFNfaLiab', u'nCLWc', u'timesInteEBIT', u'timesInteEBITDA', u'timesInteCF']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiStctISGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）：1、计算依据为该公司该期间最新一次披露的财务数据；2、计算起始期间为'2007-03-31'；3、单位：人民币元；4、部分科目仅对一般工商业公司进行计算。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiStctIS.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiStctISGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiStctISGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'rTR', u'TCOGSTR', u'COGSTR', u'btaxSurchgTR', u'periodExpTR', u'sellExpTR', u'adminExpTR', u'finanExpTR', u'ailTR', u'opaPTR', u'valChgPTR', u'fvChgGTR', u'invIncTR', u'opTR', u'nopgTR', u'noplTR', u'tpTR', u'itTR', u'NITR', u'EBITDATR', u'EBITTR', u'opaPTp', u'valChgPTp', u'opTp', u'nNopiTp', u'itTp', u'NICutNI']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiCashGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标：1、计算依据为该公司该期间最新一次披露的财务数据；2、计算起始期间为'2007-03-31'；3、单位：人民币元；4、部分科目仅对一般工商业公司进行计算（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiCash.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiCashGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiCashGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'arR', u'advRR', u'CFsgsR', u'nCFOpaTR', u'nCFOpaR', u'nCFOpaOpap', u'nCFOpaOp', u'pFixAODa', u'cRcvryA', u'nCFOpaPropt', u'nCFIaPropt', u'nCFFaPropt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiStctBSGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）：1、计算依据为该公司该期间最新一次披露的财务数据； 2、计算起始期间为'2007-03-31'；3、单位：人民币元；4、部分科目仅对一般工商业公司进行计算。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，S1-半年报，CQ3-三季报（累计1-9月），A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiStctBS.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiStctBSGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiStctBSGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'cTa', u'arTa', u'repayTa', u'invenTa', u'caTa', u'fixedATa', u'tFixedATa', u'intanATa', u'ltAmorExpTa', u'ncaTa', u'apTa', u'advRTa', u'stBorrTa', u'ltBorrTa', u'bpTa', u'nTanATa', u'treTa', u'teapTa', u'tseTa', u'idIc', u'teapIc', u'clTa', u'nclTa', u'equMultiplier', u'capFixRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFBankQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据银行业上市公司披露的现金流量表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元4、期间内变动金额计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度Q3:若上市公司披露第三季度数据，直接取上市公司披露数据；若未披露则：前三季度-半年度Q4:年度-前三季度5、期初现金及现金等价物余额取上一会计期间期末值；期末现金及现金等价物余额取报表原值6、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFBankQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFBankQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFBankQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'CPaidInvest', u'purFixAssetsOth', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInduQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据一般工商业上市公司披露的现金流量表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元4、期间内变动金额计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度Q3:若上市公司披露第三季度数据，直接取上市公司披露数据；若未披露则：前三季度-半年度Q4:年度-前三季度5、期初现金及现金等价物余额取上一会计期间期末值；期末现金及现金等价物余额取报表原值6、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInduQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInduQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInduQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInsuQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据保险业上市公司披露的现金流量表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元4、期间内变动金额计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度Q3:若上市公司披露第三季度数据，直接取上市公司披露数据；若未披露则：前三季度-半年度Q4:年度-前三季度5、期初现金及现金等价物余额取上一会计期间期末值；期末现金及现金等价物余额取报表原值6、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInsuQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInsuQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInsuQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据各个行业单季度现金流量表表整合的合并单季度数据（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFSecuQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据证券业上市公司披露的现金流量表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元4、期间内变动金额计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度Q3:若上市公司披露第三季度数据，直接取上市公司披露数据；若未披露则：前三季度-半年度Q4:年度-前三季度5、期初现金及现金等价物余额取上一会计期间期末值；期末现金及现金等价物余额取报表原值6、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFSecuQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFSecuQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFSecuQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'CPaidInvest', u'purFixAssetsOth', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISBankQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据银行业上市公司披露的利润表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元4、计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度Q3:直接取上市公司披露数据Q4:年度-前三季度5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISBankQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISBankQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISBankQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInduQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据一般工商业上市公司披露的利润表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元4、计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度Q3:直接取上市公司披露数据Q4:年度-前三季度5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInduQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInduQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInduQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInsuQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据保险业上市公司披露的利润表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元4、计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度Q3:直接取上市公司披露数据Q4:年度-前三季度5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInsuQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInsuQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInsuQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'commisExp', u'genlAdminExp', u'reinsCostRefund', u'othOperCosts', u'assetsImpairLoss', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据各个行业单季度利润表整合的合并单季度数据（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISSecuQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据证券业上市公司披露的利润表计算的单季度数据：1、计算依据为该公司该期间最新一次披露的财务数据2、计算起始期间为'2007-03-31'3、单位：人民币元4、计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度Q3:直接取上市公司披露数据Q4:年度-前三季度5、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISSecuQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISSecuQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISSecuQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'revenue', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'NIntIncome', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtDerQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）：1、计算依据为该公司该期间最新一次披露的财务数据计算的单季度报表；2、单位：人民币元； 3、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtDerQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtDerQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtDerQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'grossProfit', u'opaProfit', u'valChgProfit', u'nrProfitLoss', u'niCut']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiQGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）：1、计算依据为该公司该期间最新一次披露的财务数据计算的单季度报表；2、单位：人民币元；3、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'EPS', u'grossMARgin', u'npMARgin', u'ROE', u'ROEA', u'ROECutA', u'ROA', u'periodExpTR', u'pCostExp', u'NITR', u'sellExpTR', u'adminExpTR', u'finanExpTR', u'ailTR', u'TCOGSTR', u'COGSTR', u'opTR', u'opaPTp', u'valChgPTp', u'NICutNI', u'faTurnover', u'caTurnover', u'taTurnover', u'invenTurnover', u'daysInven', u'ARTurnover', u'daysAR', u'operCycle', u'APTurnover', u'daysAP', u'CFsgsR', u'nCFOpaR', u'nCFOpaOpap', u'nCFOpaNIAttrP', u'tRevenueYOY', u'tRevenueQOQ', u'revenueYOY', u'revenueQOQ', u'operProfitYOY', u'operProfitQOQ', u'niYOY', u'niQOQ', u'niAttrPYOY', u'niAttrPQOQ', u'niAttrPCutYOY', u'niAttrPCutQOQ']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFBankQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据银行业上市公司披露的现金流量表计算的单季度数据：1、计算依据为该公司所有披露的财务报表2、单位：人民币元3、期间内变动金额计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度，取值条件：半年度数据发布日期大于第一季度数据,且在此条件下，第一季度数据发布时间最新Q3:若上市公司披露第三季度数据，直接取上市公司披露数据；若未披露则：前三季度-半年度，取值条件：前三季度数据发布日期大于半年度数据,且在此条件下，半年度数据发布时间最新Q4:年度-前三季度，取值条件：年度数据发布日期大于前三季度数据,且
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFBankQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFBankQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFBankQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'CPaidInvest', u'purFixAssetsOth', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInduQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据一般工商业上市公司披露的现金流量表计算的单季度数据：1、计算依据为该公司所有披露的财务报表2、单位：人民币元3、期间内变动金额计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度，取值条件：半年度数据发布日期大于第一季度数据,且在此条件下，第一季度数据发布时间最新Q3:若上市公司披露第三季度数据，直接取上市公司披露数据；若未披露则：前三季度-半年度，取值条件：前三季度数据发布日期大于半年度数据,且在此条件下，半年度数据发布时间最新Q4:年度-前三季度，取值条件：年度数据发布日期大于前三季度数
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInduQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInduQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInduQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInsuQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据保险业上市公司披露的现金流量表计算的单季度数据：1、计算依据为该公司所有披露的财务报表2、单位：人民币元3、期间内变动金额计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度，取值条件：半年度数据发布日期大于第一季度数据,且在此条件下，第一季度数据发布时间最新Q3:若上市公司披露第三季度数据，直接取上市公司披露数据；若未披露则：前三季度-半年度，取值条件：前三季度数据发布日期大于半年度数据,且在此条件下，半年度数据发布时间最新Q4:年度-前三季度，取值条件：年度数据发布日期大于前三季度数据,且
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInsuQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInsuQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInsuQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据各个行业单季度现金流量表表整合的合并单季度数据（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFSecuQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据证券业上市公司披露的现金流量表计算的单季度数据：1、计算依据为该公司所有披露的财务报表2、单位：人民币元3、期间内变动金额计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度，取值条件：半年度数据发布日期大于第一季度数据,且在此条件下，第一季度数据发布时间最新Q3:若上市公司披露第三季度数据，直接取上市公司披露数据；若未披露则：前三季度-半年度，取值条件：前三季度数据发布日期大于半年度数据,且在此条件下，半年度数据发布时间最新Q4:年度-前三季度，取值条件：年度数据发布日期大于前三季度数据,且
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFSecuQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFSecuQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFSecuQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'CPaidInvest', u'purFixAssetsOth', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISBankQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据银行业上市公司披露的利润表计算的单季度数据：1、计算依据为该公司所有披露的财务报表2、单位：人民币元3、计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度，取值条件：半年度数据发布日期大于第一季度数据,且在此条件下，第一季度数据发布时间最新Q3:直接取上市公司披露数据Q4:年度-前三季度，取值条件：年度数据发布日期大于前三季度数据,且在此条件下，前三季度数据发布时间最新4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISBankQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISBankQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISBankQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInduQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据一般工商业上市公司披露的利润表计算的单季度数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下： Q1:直接取上市公司披露数据 Q2:半年度-第一季度，取值条件：半年度数据发布日期大于第一季度数据，且在此条件下，第一季度数据发布时间最新 Q3:直接取上市公司披露数据 Q4:年度-前三季度，取值条件：年度数据发布日期大于前三季度数据，且在此条件下，前三季度数据发布时间最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInduQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInduQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInduQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInsuQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据保险业上市公司披露的利润表计算的单季度数据：1、计算依据为该公司所有披露的财务报表2、单位：人民币元3、计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度，取值条件：半年度数据发布日期大于第一季度数据,且在此条件下，第一季度数据发布时间最新Q3:直接取上市公司披露数据Q4:年度-前三季度，取值条件：年度数据发布日期大于前三季度数据,且在此条件下，前三季度数据发布时间最新4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInsuQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInsuQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInsuQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'commisExp', u'genlAdminExp', u'reinsCostRefund', u'othOperCosts', u'assetsImpairLoss', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据各个行业单季度利润表整合的合并单季度数据（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISSecuQPITGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据证券业上市公司披露的利润表计算的单季度数据：1、计算依据为该公司所有披露的财务报表2、单位：人民币元3、计算逻辑如下：Q1:直接取上市公司披露数据Q2:半年度-第一季度，取值条件：半年度数据发布日期大于第一季度数据,且在此条件下，第一季度数据发布时间最新Q3:直接取上市公司披露数据Q4:年度-前三季度，取值条件：年度数据发布日期大于前三季度数据,且在此条件下，前三季度数据发布时间最新4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致单季度计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份，输入格式\YYYY\"",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报，Q2-第二季报，Q3-第三季报，Q4-第四季报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISSecuQPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISSecuQPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISSecuQPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'revenue', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'NIntIncome', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFBankTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据银行业上市公司披露的现金流量表计算的TTM数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下：会计期末为12-31，则取原始披露值，否则为：本期值+上年年度值-上年同期值; 取上年年度值和上年同期值的条件为：发布时间早于本期值且最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致TTM计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFBankTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFBankTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFBankTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'NDecrInDisburOfLa', u'NDecrInDeposInFI', u'NDecrLoanToOthFI', u'IFCCashIncr', u'CFrOthOperateA', u'CInfFrOperateA', u'NDeposDecrFrFI', u'NDecrBorrFrCB', u'NDecrBorrFrOthFI', u'NIncDisburOfLA', u'NIncrDeposInFI', u'NIncrLoansToOthFi', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'CPaidInvest', u'purFixAssetsOth', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInduTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据一般工商业上市公司披露的现金流量表计算的TTM数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下：会计期末为12-31，则取原始披露值，否则为：本期值+上年年度值-上年同期值; 取上年年度值和上年同期值的条件为：发布时间早于本期值且最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致TTM计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInduTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInduTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInduTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFInsuTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据保险业上市公司披露的现金流量表计算的TTM数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下：会计期末为12-31，则取原始披露值，否则为：本期值+上年年度值-上年同期值; 取上年年度值和上年同期值的条件为：发布时间早于本期值且最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致TTM计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFInsuTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFInsuTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFInsuTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'IFCCashIncr', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'PurFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFSecuTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据证券业上市公司披露的现金流量表计算的TTM数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下：会计期末为12-31，则取原始披露值，否则为：本期值+上年年度值-上年同期值; 取上年年度值和上年同期值的条件为：发布时间早于本期值且最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致TTM计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFSecuTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFSecuTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFSecuTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'NIncBorrOthFI', u'NIncDispTradFA', u'NIncDispFaFS', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidIFC', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'CPaidInvest', u'purFixAssetsOth', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtCFTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据各个行业TTM现金流量表表整合的合并TTM数据（含科创板）。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtCFTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtCFTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtCFTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'CFrSaleGS', u'NDeposIncrCFI', u'NIncrBorrFrCB', u'NIncBorrOthFI', u'premFrOrigContr', u'NReinsurPrem', u'NIncPhDeposInv', u'NIncDispTradFA', u'IFCCashIncr', u'NIncFrBorr', u'NCApIncrRepur', u'refundOfTax', u'CFrOthOperateA', u'CInfFrOperateA', u'CPaidGS', u'NIncDisburOfLA', u'NIncrDeposInFI', u'origContrCIndem', u'CPaidIFC', u'CPaidPolDiv', u'CPaidToForEmpl', u'CPaidForTaxes', u'CPaidForOthOpA', u'COutfOperateA', u'NCFOperateA', u'procSellInvest', u'gainInvest', u'dispFixAssetsOth', u'NDispSubsOthBizC', u'CFrOthInvestA', u'CInfFrInvestA', u'purFixAssetsOth', u'CPaidInvest', u'NIncrPledgeLoan', u'NCPaidAcquis', u'CPaidOthInvestA', u'COutfFrInvestA', u'NCFFrInvestA', u'CFrCapContr', u'CFrMinoSSubs', u'CFrBorr', u'CFrIssueBond', u'CFrOthFinanA', u'CInfFrFinanA', u'CPaidForDebts', u'CPaidDivProfInt', u'divProfSubsMinoS', u'CPaidOthFinanA', u'COutfFrFinanA', u'NCFFrFinanA', u'forexEffects', u'NChangeInCash', u'NCEBegBal', u'NCEEndBal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISBankTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据银行业上市公司披露的利润表计算的TTM数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下：会计期末为12-31，则取原始披露值，否则为：本期值+上年年度值-上年同期值; 取上年年度值和上年同期值的条件为：发布时间早于本期值且最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致TTM计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISBankTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISBankTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISBankTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'revenue', u'NIntIncome', u'intIncome', u'intExp', u'NCommisIncome', u'commisIncome', u'commisExp', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInduTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据一般工商业上市公司披露的利润表计算的TTM数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下：会计期末为12-31，则取原始披露值，否则为：本期值+上年年度值-上年同期值; 取上年年度值和上年同期值的条件为：发布时间早于本期值且最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致TTM计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInduTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInduTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInduTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISInsuTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据保险业上市公司披露的利润表计算的TTM数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下：会计期末为12-31，则取原始披露值，否则为：本期值+上年年度值-上年同期值; 取上年年度值和上年同期值的条件为：发布时间早于本期值且最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致TTM计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISInsuTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISInsuTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISInsuTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'revenue', u'premEarned', u'grossPremWrit', u'reinsIncome', u'reinsur', u'unePremReser', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'premRefund', u'compensPayout', u'compensPayoutRefu', u'reserInsurLiab', u'insurLiabReserRefu', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'commisExp', u'genlAdminExp', u'reinsCostRefund', u'othOperCosts', u'assetsImpairLoss', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISSecuTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据证券业上市公司披露的利润表计算的TTM数据： 1、计算依据为该公司所有披露的财务报表 2、单位：人民币元 3、计算逻辑如下：会计期末为12-31，则取原始披露值，否则为：本期值+上年年度值-上年同期值; 取上年年度值和上年同期值的条件为：发布时间早于本期值且最新 4、由于企业可能发生借壳上市、资产重组，及本身报表的错报，导致TTM计算数据可靠性降低
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISSecuTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISSecuTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISSecuTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'revenue', u'NCommisIncome', u'NSecTaIncome', u'NUndwrtSecIncome', u'NTrustIncome', u'NIntIncome', u'investIncome', u'AJInvestIncome', u'fValueChgGain', u'forexGain', u'assetsDispGain', u'othGain', u'othOperRev', u'COGS', u'bizTaxSurchg', u'genlAdminExp', u'assetsImpairLoss', u'othOperCosts', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtISTTMPITGet(ticker = "", secID = "", endDate = "", beginDate = "", publishDateEnd = "", publishDateBegin = "", isNew = "", isCalc = "", field = "", pandas = "1"):
    """
    根据各个行业TTM利润表整合的合并TTM数据
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate至少选择一个
    :param publishDateEnd: 证券交易所披露的信息发布日期范围的结束日期，输入格式“YYYYMMDD”,可空
    :param publishDateBegin: 证券交易所披露的信息发布日期范围的起始日期，输入格式“YYYYMMDD”,可空
    :param isNew: 是否最新。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param isCalc: 是否计算。1-是；0-否。对应DataAPI.SysCodeGet.codeTypeID=10007。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtISTTMPIT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        publishDateEnd = publishDateEnd.strftime('%Y%m%d')
    except:
        publishDateEnd = publishDateEnd.replace('-', '')
    requestString.append("&publishDateEnd=%s"%(publishDateEnd))
    try:
        publishDateBegin = publishDateBegin.strftime('%Y%m%d')
    except:
        publishDateBegin = publishDateBegin.replace('-', '')
    requestString.append("&publishDateBegin=%s"%(publishDateBegin))
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&isCalc=")
    if hasattr(isCalc,'__iter__') and not isinstance(isCalc, str):
        if len(isCalc) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isCalc
            requestString.append(None)
        else:
            requestString.append(','.join(isCalc))
    else:
        requestString.append(isCalc)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtISTTMPITGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtISTTMPITGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'isNew', u'isCalc', u'tRevenue', u'revenue', u'intIncome', u'premEarned', u'commisIncome', u'TCogs', u'COGS', u'intExp', u'commisExp', u'premRefund', u'NCompensPayout', u'reserInsurContr', u'policyDivPayt', u'reinsurExp', u'bizTaxSurchg', u'sellExp', u'adminExp', u'finanExp', u'assetsImpairLoss', u'fValueChgGain', u'investIncome', u'AJInvestIncome', u'forexGain', u'assetsDispGain', u'othGain', u'operateProfit', u'NoperateIncome', u'NoperateExp', u'NCADisploss', u'TProfit', u'incomeTax', u'NIncome', u'goingConcernNI', u'quitConcernNI', u'NIncomeAttrP', u'minorityGain', u'othComprIncome', u'TComprIncome', u'comprIncAttrP', u'comprIncAttrMS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtMoStdItemGet(ticker = "", secID = "", beginDate = "", endDate = "", classifCD = "", field = "", pandas = "1"):
    """
    1、上市公司主营业务收入来源（含科创板），2、包含指标营业收入、营业成本、毛利润、毛利率、收入占比、成本占比、收入同比、成本同比、毛利润同比、毛利率同比，3、可通过项目代码关联各个报告期项目对比查看多报告期主营业务变化情况。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据会计期间截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param classifCD: 分类方式。1-按行业，2-按产品，3-按地区,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtMoStdItem.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&classifCD=")
    if hasattr(classifCD,'__iter__') and not isinstance(classifCD, str):
        if len(classifCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = classifCD
            requestString.append(None)
        else:
            requestString.append(','.join(classifCD))
    else:
        requestString.append(classifCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtMoStdItemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtMoStdItemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'partyID', u'endDate', u'classifCD', u'itemID', u'itemName', u'itemIDSuperior', u'itemNameSuperior', u'revenue', u'revIsPctge', u'tRevIsPctge', u'revYOY', u'cogs', u'cogsIsPctge', u'tCogsIsPctge', u'cogsYOY', u'grossProfit', u'grossProfitYOY', u'grossMargin', u'grossMarginYOY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','itemName': 'str','itemNameSuperior': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtIndiDupontGet(ticker = "", secID = "", endDate = "", beginDate = "", beginYear = "", endYear = "", reportType = "", field = "", pandas = "1"):
    """
    根据上市公司披露的财务数据计算的财务指标（含科创板）：1、计算依据为该公司该期间最新一次披露的财务数据；2、计算起始期间为'2007-03-31'；3、单位：人民币元；4、部分指标仅对一般工商业公司进行计算。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param secID: 通联编制的证券编码,格式是“交易代码.证券市场代码”,如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endDate: 根据会计期间截止日期范围查询的结束日期,输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginDate: 根据会计期间截止日期范围查询的起始日期,输入格式“YYYYMMDD”,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param beginYear: 根据会计期间截止日期范围查询的起始年份,输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param endYear: 根据会计期间截止日期范围查询的结束年份,输入格式"YYYY",ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param reportType: 报告类型。Q1-第一季报,S1-半年报,CQ3-三季报（累计1-9月）,A-年报。对应DataAPI.SysCodeGet.codeTypeID=70001。,可以是列表,ticker、secID、endDate、beginDate、beginYear、endYear、reportType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtIndiDupont.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtIndiDupontGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtIndiDupontGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'ROE', u'ROA', u'equMultiplierDupont', u'assetLiabRatio', u'minorityAsset', u'niAttrPNi', u'npMargin', u'taTurnover', u'tRevenue', u'revenue', u'finRevenue', u'tCogs', u'cogs', u'periodExp', u'sellExp', u'adminExp', u'finanExp', u'bizTaxSurchg', u'assetsImpairLoss', u'valChgProfit', u'noperateProfit', u'incomeTax', u'tAssetsA', u'tAssets', u'tAssetsBgn', u'tLiabA', u'tLiab', u'tLiabBgn', u'minorityIntA', u'minorityInt', u'minorityIntBgn', u'tCa', u'tNca', u'cashCEquiv', u'ar', u'prepayment', u'inventories', u'fixedAssets', u'cip', u'intanAssets']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtMonthdataSecuGet(partyID = "", compAlias = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司母公司或者子公司为证券行业每个月披露的净资产、营业收入和净利润数据。
    
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,partyID、compAlias、beginDate、endDate至少选择一个
    :param compAlias: 机构别名，支持模糊查询，如“申万宏源”,partyID、compAlias、beginDate、endDate至少选择一个
    :param beginDate: 会计期间起始日期，输入格式“YYYYMMDD”,partyID、compAlias、beginDate、endDate至少选择一个
    :param endDate: 会计期间截止日期，输入格式“YYYYMMDD”,partyID、compAlias、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtMonthdataSecu.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    if not isinstance(compAlias, str) and not isinstance(compAlias, unicode):
        compAlias = str(compAlias)

    requestString.append("&compAlias=%s"%(compAlias))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtMonthdataSecuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtMonthdataSecuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'compAlias', u'mergedFlag', u'endDate', u'publishDate', u'revenue', u'nIncome', u'tShEquity', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'compAlias': 'str','mergedFlag': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtMesoInduGet(beginDate, industry = "", typeID = "", typeName = "", itemID = "", endDate = "", field = "", pandas = "1"):
    """
    根据所属行业对应的上市公司披露的财务数据（涉及资产负债表、利润表和现金流量表主要科目）进行行业数据整合，一般周期为季度披露。
    
    :param beginDate: 报告期起始查询日期
    :param industry: 行业类别，支持模糊查询，如“申万一级”,industry、typeID、typeName至少选择一个
    :param typeID: 行业分类代码，可于getIndustry接口查询,可以是列表,industry、typeID、typeName至少选择一个
    :param typeName: 行业分类名称，支持模糊查询,industry、typeID、typeName至少选择一个
    :param itemID: 科目代码，如HBBS0008-应收账款,可以是列表,可空
    :param endDate: 报告期截止查询日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtMesoIndu.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(industry, str) and not isinstance(industry, unicode):
        industry = str(industry)

    requestString.append("&industry=%s"%(industry))
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    if not isinstance(typeName, str) and not isinstance(typeName, unicode):
        typeName = str(typeName)

    requestString.append("&typeName=%s"%(typeName))
    requestString.append("&itemID=")
    if hasattr(itemID,'__iter__') and not isinstance(itemID, str):
        if len(itemID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemID
            requestString.append(None)
        else:
            requestString.append(','.join(itemID))
    else:
        requestString.append(itemID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtMesoInduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtMesoInduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'industry', u'typeID', u'typeName', u'endDate', u'itemID', u'itemName', u'value', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industry': 'str','typeID': 'str','typeName': 'str','itemID': 'str','itemName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FdmtMainOperNGet(partyID = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    描述上市公司定期公告中披露的主营业务明细信息，与公告披露保持一致（含科创板）：1、公司在公告中每次披露的构成内容均会采集；2、主营业务构成有三种分类方式：分行业、分产品、分地区；3、采集公告起始报告期为2007半年度报告；4、单位：人民币元。
    
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,partyID、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,partyID、secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,partyID、secID、ticker至少选择一个
    :param beginDate: 会计区间起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 会计区间截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fundamental/getFdmtMainOperN.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FdmtMainOperNGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FdmtMainOperNGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'actPubtime', u'publishDate', u'endDate', u'fiscalPeriod', u'mergeFlag', u'classifCD', u'isLatest', u'industry', u'itemParentNo', u'itemNo', u'itemName', u'revenue', u'revPctge', u'revIsPctge', u'tRevIsPctge', u'cogs', u'costPctge', u'cogsIsPctge', u'tCogsIsPctge', u'grossProfit', u'grossMargin', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','industry': 'str','itemName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AllEquGet(ticker = "", field = "", pandas = "1"):
    """
    获取全部沪深股票
    
    :param ticker: 证券ID,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getAllEqu.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AllEquGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AllEquGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangecd', u'currencycd']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangecd': 'str','currencycd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5dcovarianceGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5dcovariance.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5dcovarianceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5dcovarianceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ID', u'dataDate', u'factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'ENERGY', u'CHEM', u'CONMAT', u'MTLMIN', u'MATERIAL', u'AERODEF', u'BLDPROD', u'CNSTENG', u'ELECEQP', u'INDCONG', u'MACH', u'TRDDIST', u'COMSERV', u'AIRLINE', u'MARINE', u'RDRLTRAN', u'AUTO', u'HOUSEDUR', u'LEISLUX', u'CONSSERV', u'MEDIA', u'RETAIL', u'PERSPRD', u'BEV', u'FOODPROD', u'HEALTH', u'BANKS', u'DVFININS', u'REALEST', u'SOFTWARE', u'HDWRSEMI', u'UTILITIE', u'COUNTRY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5dexposureGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5dexposure.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5dexposureGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5dexposureGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'dataDate', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'ENERGY', u'CHEM', u'CONMAT', u'MTLMIN', u'MATERIAL', u'AERODEF', u'BLDPROD', u'CNSTENG', u'ELECEQP', u'INDCONG', u'MACH', u'TRDDIST', u'COMSERV', u'AIRLINE', u'MARINE', u'RDRLTRAN', u'AUTO', u'HOUSEDUR', u'LEISLUX', u'CONSSERV', u'MEDIA', u'RETAIL', u'PERSPRD', u'BEV', u'FOODPROD', u'HEALTH', u'BANKS', u'DVFININS', u'REALEST', u'SOFTWARE', u'HDWRSEMI', u'UTILITIE', u'COUNTRY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','dataDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5dsriskGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5dsrisk.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5dsriskGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5dsriskGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'barraID', u'ticker', u'dataDate', u'risk']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'barraID': 'str','ticker': 'str','dataDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5lcovarianceGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5lcovariance.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5lcovarianceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5lcovarianceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ID', u'dataDate', u'factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'ENERGY', u'CHEM', u'CONMAT', u'MTLMIN', u'MATERIAL', u'AERODEF', u'BLDPROD', u'CNSTENG', u'ELECEQP', u'INDCONG', u'MACH', u'TRDDIST', u'COMSERV', u'AIRLINE', u'MARINE', u'RDRLTRAN', u'AUTO', u'HOUSEDUR', u'LEISLUX', u'CONSSERV', u'MEDIA', u'RETAIL', u'PERSPRD', u'BEV', u'FOODPROD', u'HEALTH', u'BANKS', u'DVFININS', u'REALEST', u'SOFTWARE', u'HDWRSEMI', u'UTILITIE', u'COUNTRY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5lexposureGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5lexposure.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5lexposureGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5lexposureGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'dataDate', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'ENERGY', u'CHEM', u'CONMAT', u'MTLMIN', u'MATERIAL', u'AERODEF', u'BLDPROD', u'CNSTENG', u'ELECEQP', u'INDCONG', u'MACH', u'TRDDIST', u'COMSERV', u'AIRLINE', u'MARINE', u'RDRLTRAN', u'AUTO', u'HOUSEDUR', u'LEISLUX', u'CONSSERV', u'MEDIA', u'RETAIL', u'PERSPRD', u'BEV', u'FOODPROD', u'HEALTH', u'BANKS', u'DVFININS', u'REALEST', u'SOFTWARE', u'HDWRSEMI', u'UTILITIE', u'COUNTRY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','dataDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5lsriskGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5lsrisk.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5lsriskGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5lsriskGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'barraID', u'ticker', u'dataDate', u'risk']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'barraID': 'str','ticker': 'str','dataDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5scovarianceGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5scovariance.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5scovarianceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5scovarianceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ID', u'dataDate', u'factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'ENERGY', u'CHEM', u'CONMAT', u'MTLMIN', u'MATERIAL', u'AERODEF', u'BLDPROD', u'CNSTENG', u'ELECEQP', u'INDCONG', u'MACH', u'TRDDIST', u'COMSERV', u'AIRLINE', u'MARINE', u'RDRLTRAN', u'AUTO', u'HOUSEDUR', u'LEISLUX', u'CONSSERV', u'MEDIA', u'RETAIL', u'PERSPRD', u'BEV', u'FOODPROD', u'HEALTH', u'BANKS', u'DVFININS', u'REALEST', u'SOFTWARE', u'HDWRSEMI', u'UTILITIE', u'COUNTRY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5sexposureGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5sexposure.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5sexposureGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5sexposureGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'dataDate', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'ENERGY', u'CHEM', u'CONMAT', u'MTLMIN', u'MATERIAL', u'AERODEF', u'BLDPROD', u'CNSTENG', u'ELECEQP', u'INDCONG', u'MACH', u'TRDDIST', u'COMSERV', u'AIRLINE', u'MARINE', u'RDRLTRAN', u'AUTO', u'HOUSEDUR', u'LEISLUX', u'CONSSERV', u'MEDIA', u'RETAIL', u'PERSPRD', u'BEV', u'FOODPROD', u'HEALTH', u'BANKS', u'DVFININS', u'REALEST', u'SOFTWARE', u'HDWRSEMI', u'UTILITIE', u'COUNTRY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','dataDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __cne5ssriskGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getcne5ssrisk.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__cne5ssriskGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__cne5ssriskGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'barraID', u'ticker', u'dataDate', u'risk']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'barraID': 'str','ticker': 'str','dataDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FloatSizeGet(field = "", pandas = "1"):
    """
    
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getFloatSize.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FloatSizeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FloatSizeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'ticker', u'exchangeCD', u'typeID', u'typeName', u'floatSize', u'typeSymbol']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','typeID': 'str','typeName': 'str','typeSymbol': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquDivTCGet(ticker, beginYear = "", endYear = "", field = "", pandas = "1"):
    """
    获取上市公司每年派现总额
    
    :param ticker: 交易代码,如'000002',可以是列表
    :param beginYear: 会计年度起始时间，输入格式"YYYY",可空
    :param endYear: 会计年度结束时间，输入格式"YYYY",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquDivTC.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(beginYear, str) and not isinstance(beginYear, unicode):
        beginYear = str(beginYear)

    requestString.append("&beginYear=%s"%(beginYear))
    if not isinstance(endYear, str) and not isinstance(endYear, unicode):
        endYear = str(endYear)

    requestString.append("&endYear=%s"%(endYear))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquDivTCGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquDivTCGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'endYear', u'TDiv']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquShareOutLatestGet(ticker, field = "", pandas = "1"):
    """
    获取上市公司最新流通股股本
    
    :param ticker: 股票代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShareOutLatest.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquShareOutLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquShareOutLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'changeDate', u'floatShares']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __IRAIPOCapGet(beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取IPO每个交易日募集的资金数量
    
    :param beginDate: 查询开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getIRAIPOCap.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__IRAIPOCapGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__IRAIPOCapGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'raiseCapSum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquIPOGet(secID = "", ticker = "", eventProcessCD = "", field = "", pandas = "1"):
    """
    获取股票首次公开发行上市的基本信息，包含股票首次公开发行的进程及发行结果。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 股票代码，如'000001',可以是列表,可空
    :param eventProcessCD: 发行进程。例如，9-上市；10-撤销上市。对应DataAPI.SysCodeGet.codeTypeID=20001。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRRPEquIPO.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&eventProcessCD=")
    if hasattr(eventProcessCD,'__iter__') and not isinstance(eventProcessCD, str):
        if len(eventProcessCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventProcessCD
            requestString.append(None)
        else:
            requestString.append(','.join(eventProcessCD))
    else:
        requestString.append(eventProcessCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquIPOGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquIPOGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'publishDate', u'eventProcessCD', u'listDate', u'issueSharesPlanMax', u'issueSharesPlanMin', u'onlineIssueSharesPlan', u'onlineIssueSharesBack', u'onlineSubMax', u'onlineSubMin', u'onlineSubUnit', u'onlineApplyNumVld', u'onlineApplySharesVld', u'onlineIssueDate', u'onlineIssueShares', u'onlineIssueLottoRatioIntl', u'onlineIssueLottoRatio', u'onlineTNumAllot', u'onlineIssueCode', u'onlineSubsShares', u'onlineSubsSharesQuit', u'onlineUwShares', u'offlineIssueDateBgn', u'offlineIssueDateEnd', u'offlineIssueSharesPlan', u'offlineIssueSharesBack', u'offlineSubMax', u'offlineSubMin', u'offlineSubUnit', u'offlineQuoteNumVld', u'offlineQuoteSharesVld', u'offlineApplyNum', u'offlineApplyTimes', u'offlineApplyNumVld', u'offlineApplySharesVld', u'offlineIssueShares', u'offlineSubsShares', u'offlineSubsSharesQuit', u'offlineUwShares', u'newIssueShares', u'transShares', u'newIssueRaiseCap', u'oldShareRaiseCap', u'issueShares', u'tSharesBfIPO', u'tSharesAfIPO', u'issuePrice', u'currencyCD', u'beforeIssuePE', u'issuePE', u'firstDayOpenPrice', u'firstDayClosePrice', u'listPE', u'ICSRS', u'leadUnderwriter', u'nIncome', u'nIncomeAttrP', u'niAttrPCut', u'basicEPS', u'EPS', u'EPSCut', u'primeOperating', u'profile', u'email', u'tel', u'postAddr', u'postCode', u'remark']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','onlineIssueCode': 'str','transShares': 'str','currencyCD': 'str','ICSRS': 'str','leadUnderwriter': 'str','primeOperating': 'str','profile': 'str','email': 'str','tel': 'str','postAddr': 'str','postCode': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquIPOPlanGet(secID = "", ticker = "", onlineArrangeCD = "", offlineArrangeCD = "", dateIPO = "", field = "", pandas = "1"):
    """
    获取股票首次公开发行网上配售中签号码。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 股票代码,可以是列表,可空
    :param onlineArrangeCD: 网上发行安排代码。1-确定发行价格;2-网上路演;3-网上发行申购;4-中签率公布日;5-网上中签结果发布和申购缴款;6-发行结果公布。对应DataAPI.SysCodeGet.codeTypeID=90004。,可以是列表,可空
    :param offlineArrangeCD: 网下发行安排代码。1-提交核查材料截止日;2-初步询价开始日;3-初步询价截止日;4-确定发行价格;5-网下发行申购;6-网下投资者获配缴款;7-发行结果公布。对应DataAPI.SysCodeGet.codeTypeID=90005。,可以是列表,可空
    :param dateIPO: 计划发行进程日期,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRRPEquIPOPlan.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&onlineArrangeCD=")
    if hasattr(onlineArrangeCD,'__iter__') and not isinstance(onlineArrangeCD, str):
        if len(onlineArrangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = onlineArrangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(onlineArrangeCD))
    else:
        requestString.append(onlineArrangeCD)
    requestString.append("&offlineArrangeCD=")
    if hasattr(offlineArrangeCD,'__iter__') and not isinstance(offlineArrangeCD, str):
        if len(offlineArrangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = offlineArrangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(offlineArrangeCD))
    else:
        requestString.append(offlineArrangeCD)
    requestString.append("&dateIPO=")
    if hasattr(dateIPO,'__iter__') and not isinstance(dateIPO, str):
        if len(dateIPO) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dateIPO
            requestString.append(None)
        else:
            requestString.append(','.join(dateIPO))
    else:
        requestString.append(dateIPO)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquIPOPlanGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquIPOPlanGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'publishDate', u'dateType', u'dateIPO', u'onlineArrangeCD', u'onlineArrange', u'offlineArrangeCD', u'offlineArrange', u'endTime', u'arrange']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','dateType': 'str','onlineArrange': 'str','offlineArrange': 'str','endTime': 'str','arrange': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquIPOLottoGet(secID = "", ticker = "", digitLastNums = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票首次公开发行上市的发行安排，包含网上网下不同进程。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 股票代码，如'000001',可以是列表,可空
    :param digitLastNums: 末尾位数,可以是列表,可空
    :param beginDate: 根据中签号公布日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据中签号公布日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRRPEquIPOLotto.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&digitLastNums=")
    if hasattr(digitLastNums,'__iter__') and not isinstance(digitLastNums, str):
        if len(digitLastNums) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = digitLastNums
            requestString.append(None)
        else:
            requestString.append(','.join(digitLastNums))
    else:
        requestString.append(digitLastNums)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquIPOLottoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquIPOLottoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'exchangeName', u'secShortName', u'lottPubDate', u'digitLastNums', u'lottNO']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','exchangeName': 'str','secShortName': 'str','lottNO': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquPEGet(typeSymbol = "", field = "", pandas = "1"):
    """
    获取同行业最近5家上市个股，上市日市盈率
    
    :param typeSymbol: 行业分类代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRRPEquPE.csv?ispandas=1&') 
    requestString.append("typeSymbol=")
    if hasattr(typeSymbol,'__iter__') and not isinstance(typeSymbol, str):
        if len(typeSymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeSymbol
            requestString.append(None)
        else:
            requestString.append(','.join(typeSymbol))
    else:
        requestString.append(typeSymbol)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquPEGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquPEGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeSymbol', u'typeName', u'secID1', u'ticker1', u'secShortName1', u'listDate1', u'PETTMA1', u'secID2', u'ticker2', u'secShortName2', u'listDate2', u'PETTMA2', u'secID3', u'ticker3', u'secShortName3', u'listDate3', u'PETTMA3', u'secID4', u'ticker4', u'secShortName4', u'listDate4', u'PETTMA4', u'secID5', u'ticker5', u'secShortName5', u'listDate5', u'PETTMA5']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeSymbol': 'str','typeName': 'str','secID1': 'str','ticker1': 'str','secShortName1': 'str','secID2': 'str','ticker2': 'str','secShortName2': 'str','secID3': 'str','ticker3': 'str','secShortName3': 'str','secID4': 'str','ticker4': 'str','secShortName4': 'str','secID5': 'str','ticker5': 'str','secShortName5': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquIndPEGet(typeSymbol = "", field = "", pandas = "1"):
    """
    获取证监会行业市盈率
    
    :param typeSymbol: 行业分类代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRRPEquIndPE.csv?ispandas=1&') 
    requestString.append("typeSymbol=")
    if hasattr(typeSymbol,'__iter__') and not isinstance(typeSymbol, str):
        if len(typeSymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeSymbol
            requestString.append(None)
        else:
            requestString.append(','.join(typeSymbol))
    else:
        requestString.append(typeSymbol)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquIndPEGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquIndPEGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'typeSymbol', u'typeName', u'tradeDate', u'PE', u'PETTM']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'typeSymbol': 'str','typeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpIPOApplyMRGet(ticker = "", onlineIssueCode = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    早报-新股申购
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param onlineIssueCode: 申购代码,可以是列表,可空
    :param beginDate: 根据申购日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据申购日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpIPOApplyMR.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&onlineIssueCode=")
    if hasattr(onlineIssueCode,'__iter__') and not isinstance(onlineIssueCode, str):
        if len(onlineIssueCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = onlineIssueCode
            requestString.append(None)
        else:
            requestString.append(','.join(onlineIssueCode))
    else:
        requestString.append(onlineIssueCode)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpIPOApplyMRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpIPOApplyMRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exchangeName', u'onlineIssueCode', u'onlineIssueDate', u'onlineIssueSharesPlan', u'onlineSubMax', u'onlineSubUnit', u'issueSharesPlanMin', u'issueSharesPlanMax', u'issuePrice', u'beforeIssuePE', u'issuePE']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','exchangeName': 'str','onlineIssueCode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpIPOListMRGet(ticker = "", onlineIssueCode = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    早报-新股上市
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param onlineIssueCode: 申购代码,可以是列表,可空
    :param beginDate: 根据上市日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据上市日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpIPOListMR.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&onlineIssueCode=")
    if hasattr(onlineIssueCode,'__iter__') and not isinstance(onlineIssueCode, str):
        if len(onlineIssueCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = onlineIssueCode
            requestString.append(None)
        else:
            requestString.append(','.join(onlineIssueCode))
    else:
        requestString.append(onlineIssueCode)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpIPOListMRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpIPOListMRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exchangeName', u'listDate', u'onlineIssueCode', u'onlineIssueDate', u'onlineIssueSharesPlan', u'onlineSubMax', u'onlineSubUnit', u'issueSharesPlanMin', u'issueSharesPlanMax', u'issueShares', u'issuePrice', u'beforeIssuePE', u'issuePE']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','exchangeName': 'str','onlineIssueCode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpIPOLottoPubMRGet(ticker = "", onlineIssueCode = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    早报-新股中签率公布
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param onlineIssueCode: 申购代码,可以是列表,可空
    :param beginDate: 根据中签率发布日范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据中签率发布日范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpIPOLottoPubMR.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&onlineIssueCode=")
    if hasattr(onlineIssueCode,'__iter__') and not isinstance(onlineIssueCode, str):
        if len(onlineIssueCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = onlineIssueCode
            requestString.append(None)
        else:
            requestString.append(','.join(onlineIssueCode))
    else:
        requestString.append(onlineIssueCode)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpIPOLottoPubMRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpIPOLottoPubMRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'onlineIssueLottoRatio', u'exchangeCD', u'exchangeName', u'lottoDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','onlineIssueLottoRatio': 'str','exchangeCD': 'str','exchangeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpIPOPayMRGet(ticker = "", onlineIssueCode = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    早报-新股缴款
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param onlineIssueCode: 申购代码,可以是列表,可空
    :param beginDate: 根据缴款日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据缴款日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpIPOPayMR.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&onlineIssueCode=")
    if hasattr(onlineIssueCode,'__iter__') and not isinstance(onlineIssueCode, str):
        if len(onlineIssueCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = onlineIssueCode
            requestString.append(None)
        else:
            requestString.append(','.join(onlineIssueCode))
    else:
        requestString.append(onlineIssueCode)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpIPOPayMRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpIPOPayMRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exchangeName', u'payDate', u'lottoPayAmount']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','exchangeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpBlockTradingNRGet(ticker = "", secShortName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    晚报-大宗交易
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secShortName: 证券简称,可以是列表,可空
    :param beginDate: 根据交易日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据交易日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpBlockTradingNR.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secShortName=")
    if hasattr(secShortName,'__iter__') and not isinstance(secShortName, str):
        if len(secShortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secShortName
            requestString.append(None)
        else:
            requestString.append(','.join(secShortName))
    else:
        requestString.append(secShortName)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpBlockTradingNRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpBlockTradingNRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exchangeName', u'tradeDate', u'closePrice', u'tradePrice', u'premiumRate', u'tradeVol', u'tradeVal', u'buyerBD', u'sellerBD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','exchangeName': 'str','buyerBD': 'str','sellerBD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpEquShFloatMRGet(ticker = "", secShortName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    早报-解禁
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secShortName: 证券简称,可以是列表,可空
    :param beginDate: 根据解禁日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据解禁日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpEquShFloatMR.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secShortName=")
    if hasattr(secShortName,'__iter__') and not isinstance(secShortName, str):
        if len(secShortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secShortName
            requestString.append(None)
        else:
            requestString.append(','.join(secShortName))
    else:
        requestString.append(secShortName)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpEquShFloatMRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpEquShFloatMRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exchangeName', u'floatDate', u'floatSharesNew', u'propOfFloat', u'propOfTotal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','exchangeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpEquDivMRGet(ticker = "", secShortName = "", beginDateRecord = "", endDateRecord = "", beginDateExDiv = "", endDateExDiv = "", field = "", pandas = "1"):
    """
    早报-分红
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param secShortName: 证券简称,可以是列表,可空
    :param beginDateRecord: 根据股权登记日范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDateRecord: 根据股权登记日范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param beginDateExDiv: 根据除权除息日范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDateExDiv: 根据除权除息日范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpEquDivMR.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secShortName=")
    if hasattr(secShortName,'__iter__') and not isinstance(secShortName, str):
        if len(secShortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secShortName
            requestString.append(None)
        else:
            requestString.append(','.join(secShortName))
    else:
        requestString.append(secShortName)
    try:
        beginDateRecord = beginDateRecord.strftime('%Y%m%d')
    except:
        beginDateRecord = beginDateRecord.replace('-', '')
    requestString.append("&beginDateRecord=%s"%(beginDateRecord))
    try:
        endDateRecord = endDateRecord.strftime('%Y%m%d')
    except:
        endDateRecord = endDateRecord.replace('-', '')
    requestString.append("&endDateRecord=%s"%(endDateRecord))
    try:
        beginDateExDiv = beginDateExDiv.strftime('%Y%m%d')
    except:
        beginDateExDiv = beginDateExDiv.replace('-', '')
    requestString.append("&beginDateExDiv=%s"%(beginDateExDiv))
    try:
        endDateExDiv = endDateExDiv.strftime('%Y%m%d')
    except:
        endDateExDiv = endDateExDiv.replace('-', '')
    requestString.append("&endDateExDiv=%s"%(endDateExDiv))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpEquDivMRGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpEquDivMRGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exchangeName', u'endDate', u'recordDate', u'exDivDate', u'payCashDate', u'tenShareDiv', u'tenShareTran', u'tenCashDiv', u'tenCashDivAfTax']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','exchangeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquGet(secID = "", ticker = "", equTypeCD = "", listStatusCD = "", updateTimeBegin = "", updateTimeEnd = "", field = "", pandas = "1"):
    """
    获取股票的基本信息，包含股票交易代码及其简称、股票类型、上市状态、上市板块、上市日期等；上市状态为最新数据，不显示历史变动信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、equTypeCD至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,secID、ticker、equTypeCD至少选择一个
    :param equTypeCD: 股票分类编码。例如，0201010201-A股；0201010202-B股。对应DataAPI.SysCodeGet.codeTypeID=20010。,可以是列表,secID、ticker、equTypeCD至少选择一个
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,可空
    :param updateTimeBegin: 更新时间,开始时间,输入格式"YYYY-MM-DDTHH:MM:SS",如"2016-12-31T00:00:00",可空
    :param updateTimeEnd: 更新时间,结束时间,输入格式"YYYY-MM-DDTHH:MM:SS",如"2016-12-31T00:00:00",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRRPEqu.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&equTypeCD=")
    if hasattr(equTypeCD,'__iter__') and not isinstance(equTypeCD, str):
        if len(equTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = equTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(equTypeCD))
    else:
        requestString.append(equTypeCD)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    if not isinstance(updateTimeBegin, str) and not isinstance(updateTimeBegin, unicode):
        updateTimeBegin = str(updateTimeBegin)

    requestString.append("&updateTimeBegin=%s"%(updateTimeBegin))
    if not isinstance(updateTimeEnd, str) and not isinstance(updateTimeEnd, unicode):
        updateTimeEnd = str(updateTimeEnd)

    requestString.append("&updateTimeEnd=%s"%(updateTimeEnd))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'ListSectorCD', u'ListSector', u'transCurrCD', u'cnSpell', u'secShortName', u'secFullName', u'listStatusCD', u'listDate', u'delistDate', u'equTypeCD', u'equType', u'exCountryCD', u'partyID', u'totalShares', u'nonrestFloatShares', u'nonrestfloatA', u'officeAddr', u'primeOperating', u'endDate', u'TShEquity', u'secShortNameChg', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','ListSector': 'str','transCurrCD': 'str','cnSpell': 'str','secShortName': 'str','secFullName': 'str','listStatusCD': 'str','equTypeCD': 'str','equType': 'str','exCountryCD': 'str','officeAddr': 'str','primeOperating': 'str','secShortNameChg': 'str','updateTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPEquShareFloatGet(secID = "", ticker = "", beginDate = "", endDate = "", derestrictTypeCD = "", field = "", pandas = "1"):
    """
    限售股解禁（RRP展示专用）
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param beginDate: 根据交易日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据交易日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param derestrictTypeCD: 解禁方式代码。例如，1-A股发行法人配售上市；2-增发A股法人配售上市。对应DataAPI.SysCodeGet.codeTypeID=20046。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRRPEquShareFloat.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&derestrictTypeCD=")
    if hasattr(derestrictTypeCD,'__iter__') and not isinstance(derestrictTypeCD, str):
        if len(derestrictTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = derestrictTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(derestrictTypeCD))
    else:
        requestString.append(derestrictTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPEquShareFloatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPEquShareFloatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'floatDate', u'derestrictTypeCD', u'derestrictType', u'floatSharesNew']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','derestrictTypeCD': 'str','derestrictType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquInstShTypeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    机构持股分类统计
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期（起始），输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期（结束），输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquInstShType.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquInstShTypeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquInstShTypeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'endDate', u'exchangeCD', u'instType', u'totalShareholding', u'totalShareholdingRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','instType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPInvestigationEventCalGet(beginDate = "", endDate = "", calendarType = "", calendarItem = "", field = "", pandas = "1"):
    """
    预调研事件日历，包含上市公司调研、策略会线下活动、电话会议的时间、地点、联系方式等活动信息以及调研纪要等内容。
    
    :param beginDate: 日历日期，输入格式“YYYYMMDD”,可空
    :param endDate: 日历日期，输入格式“YYYYMMDD”,可空
    :param calendarType: 日历类别，例如LIST_COMP_RES-上市公司调研；STRATEGY_MEETING-策略会线下活动；CONF_CALL-电话会议；SUMMARY-纪要干货点评,可以是列表,可空
    :param calendarItem: 日历项目,可通过DataAPI.SysCodeGet.codeTypeID=20115获取具体参数内容,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRRPInvestigationEventCal.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&calendarType=")
    if hasattr(calendarType,'__iter__') and not isinstance(calendarType, str):
        if len(calendarType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = calendarType
            requestString.append(None)
        else:
            requestString.append(','.join(calendarType))
    else:
        requestString.append(calendarType)
    requestString.append("&calendarItem=")
    if hasattr(calendarItem,'__iter__') and not isinstance(calendarItem, str):
        if len(calendarItem) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = calendarItem
            requestString.append(None)
        else:
            requestString.append(','.join(calendarItem))
    else:
        requestString.append(calendarItem)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPInvestigationEventCalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPInvestigationEventCalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'eventID', u'calendarDate', u'calendarType', u'calendarTypeCN', u'calendarItem', u'calendarItemCN', u'content']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'calendarType': 'str','calendarTypeCN': 'str','calendarItem': 'str','calendarItemCN': 'str','content': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquShMeetingNoticeGet(secID = "", ticker = "", noticeBeginDate = "", noticeEndDate = "", meetingBeginDate = "", meetingEndDate = "", recordBeginDate = "", recordEndDate = "", field = "", pandas = "1"):
    """
    关于上市公司股东大会的通知，召开时间地点，股权登记等信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param noticeBeginDate: 起始股东大会通知日期，输入格式“YYYYMMDD”,可空
    :param noticeEndDate: 截止股东大会通知日期，输入格式“YYYYMMDD”,可空
    :param meetingBeginDate: 起始现场会议召开日期，输入格式“YYYYMMDD”,可空
    :param meetingEndDate: 截止现场会议召开日期，输入格式“YYYYMMDD”,可空
    :param recordBeginDate: 起始参会登记日期，输入格式“YYYYMMDD”,可空
    :param recordEndDate: 截止参会登记日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShMeetingNotice.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        noticeBeginDate = noticeBeginDate.strftime('%Y%m%d')
    except:
        noticeBeginDate = noticeBeginDate.replace('-', '')
    requestString.append("&noticeBeginDate=%s"%(noticeBeginDate))
    try:
        noticeEndDate = noticeEndDate.strftime('%Y%m%d')
    except:
        noticeEndDate = noticeEndDate.replace('-', '')
    requestString.append("&noticeEndDate=%s"%(noticeEndDate))
    try:
        meetingBeginDate = meetingBeginDate.strftime('%Y%m%d')
    except:
        meetingBeginDate = meetingBeginDate.replace('-', '')
    requestString.append("&meetingBeginDate=%s"%(meetingBeginDate))
    try:
        meetingEndDate = meetingEndDate.strftime('%Y%m%d')
    except:
        meetingEndDate = meetingEndDate.replace('-', '')
    requestString.append("&meetingEndDate=%s"%(meetingEndDate))
    try:
        recordBeginDate = recordBeginDate.strftime('%Y%m%d')
    except:
        recordBeginDate = recordBeginDate.replace('-', '')
    requestString.append("&recordBeginDate=%s"%(recordBeginDate))
    try:
        recordEndDate = recordEndDate.strftime('%Y%m%d')
    except:
        recordEndDate = recordEndDate.replace('-', '')
    requestString.append("&recordEndDate=%s"%(recordEndDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquShMeetingNoticeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquShMeetingNoticeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'hldMeetingTypeCD', u'hldNoticeDate', u'hldMeetStartTime', u'hldMeetLocation', u'ifNetVote', u'netVoteStartDate', u'netVoteEndDate', u'netVotingCode', u'hldRecoStartDate', u'hldRecoEndDate', u'recordDate', u'ifHold', u'mettingYear', u'mettingTimes', u'meetingProceed', u'meetingResult', u'chngTypeCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','hldMeetLocation': 'str','ifNetVote': 'str','netVotingCode': 'str','ifHold': 'str','meetingProceed': 'str','meetingResult': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquShSchgGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股东持股变动情况，涵盖股东名称，成交均价，持股变动数量，变动后持股数量等信息
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始发布时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止发布时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShSchg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquShSchgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquShSchgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'cnSpell', u'shName', u'avgPrice', u'shareChanges', u'shareHoldAf', u'changeWay', u'changePeriodBegin', u'changePeriodEnd', u'remark']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','cnSpell': 'str','shName': 'str','changeWay': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquSpoaDyGet(secID = "", ticker = "", beginPlanPublishDate = "", endPlanPublishDate = "", beginShcPublishDate = "", endShcPublishDate = "", beginIecPublishDate = "", endIecPublishDate = "", field = "", pandas = "1"):
    """
    A股增发信息，记录A股上市公司公告发布日，发行价格，发行量，增发类型，股权登记日、募集资金规模等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginPlanPublishDate: 起始预案公告日期，输入格式“YYYYMMDD”,可空
    :param endPlanPublishDate: 截止预案公告日期，输入格式“YYYYMMDD”,可空
    :param beginShcPublishDate: 起始股东决议公告日期，输入格式“YYYYMMDD”,可空
    :param endShcPublishDate: 截止股东决议公告日期，输入格式“YYYYMMDD”,可空
    :param beginIecPublishDate: 起始获准公告日期，输入格式“YYYYMMDD”,可空
    :param endIecPublishDate: 截止获准公告日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSpoaDy.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginPlanPublishDate = beginPlanPublishDate.strftime('%Y%m%d')
    except:
        beginPlanPublishDate = beginPlanPublishDate.replace('-', '')
    requestString.append("&beginPlanPublishDate=%s"%(beginPlanPublishDate))
    try:
        endPlanPublishDate = endPlanPublishDate.strftime('%Y%m%d')
    except:
        endPlanPublishDate = endPlanPublishDate.replace('-', '')
    requestString.append("&endPlanPublishDate=%s"%(endPlanPublishDate))
    try:
        beginShcPublishDate = beginShcPublishDate.strftime('%Y%m%d')
    except:
        beginShcPublishDate = beginShcPublishDate.replace('-', '')
    requestString.append("&beginShcPublishDate=%s"%(beginShcPublishDate))
    try:
        endShcPublishDate = endShcPublishDate.strftime('%Y%m%d')
    except:
        endShcPublishDate = endShcPublishDate.replace('-', '')
    requestString.append("&endShcPublishDate=%s"%(endShcPublishDate))
    try:
        beginIecPublishDate = beginIecPublishDate.strftime('%Y%m%d')
    except:
        beginIecPublishDate = beginIecPublishDate.replace('-', '')
    requestString.append("&beginIecPublishDate=%s"%(beginIecPublishDate))
    try:
        endIecPublishDate = endIecPublishDate.strftime('%Y%m%d')
    except:
        endIecPublishDate = endIecPublishDate.replace('-', '')
    requestString.append("&endIecPublishDate=%s"%(endIecPublishDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquSpoaDyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquSpoaDyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'planPublishDate', u'shcPublishDate', u'iecPublishDate', u'recordDate', u'issueBeginDate', u'issueEndDate', u'exRightsDate', u'listDate', u'spoType', u'issueShares', u'preIssueRaiseCap', u'capDes', u'listPublishDate', u'allotmentRatio', u'allotmentShares', u'issuePrice', u'issueShares', u'issueRaiseCap', u'infoID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','spoType': 'str','capDes': 'str','infoID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquPlaceSubGet(securityIDInt = "", infoID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    增发配售明细，记录上市公司增发配售的相关信息，具体包括获配机构名称、获配数量、限售解禁日等。
    
    :param securityIDInt: 证券内部ID,可以是列表,securityIDInt、infoID至少选择一个
    :param infoID: 信息编码,可以是列表,securityIDInt、infoID至少选择一个
    :param beginDate: 起始限售股份解禁日，输入格式“YYYYMMDD”,可空
    :param endDate: 截止限售股份解禁日，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquPlaceSub.csv?ispandas=1&') 
    requestString.append("securityIDInt=")
    if hasattr(securityIDInt,'__iter__') and not isinstance(securityIDInt, str):
        if len(securityIDInt) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = securityIDInt
            requestString.append(None)
        else:
            requestString.append(','.join(securityIDInt))
    else:
        requestString.append(securityIDInt)
    requestString.append("&infoID=")
    if hasattr(infoID,'__iter__') and not isinstance(infoID, str):
        if len(infoID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = infoID
            requestString.append(None)
        else:
            requestString.append(','.join(infoID))
    else:
        requestString.append(infoID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquPlaceSubGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquPlaceSubGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'securityIDInt', u'infoID', u'orgName', u'orgCode', u'validApplVol', u'placeVol', u'subsRatio', u'limitPeriod', u'floatDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'securityIDInt': 'str','infoID': 'str','orgName': 'str','orgCode': 'str','validApplVol': 'str','placeVol': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquSharesFloatDyGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    限售解禁,记录上市公司限售股流通时间与数量等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 股票代码，如'000001',可以是列表,可空
    :param beginDate: 起始流通日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止流通日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSharesFloatDy.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquSharesFloatDyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquSharesFloatDyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'floatDate', u'floatNum', u'shareProperty', u'secIDInt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shareProperty': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquSharesFloatSubGet(secIDInt = "", floatDate = "", field = "", pandas = "1"):
    """
    限售解禁明细，记录上市公司限售解禁股东名称、持股数等信息（含科创板）。
    
    :param secIDInt: 证券内部ID,可以是列表,可空
    :param floatDate: 流通日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSharesFloatSub.csv?ispandas=1&') 
    requestString.append("secIDInt=")
    if hasattr(secIDInt,'__iter__') and not isinstance(secIDInt, str):
        if len(secIDInt) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secIDInt
            requestString.append(None)
        else:
            requestString.append(','.join(secIDInt))
    else:
        requestString.append(secIDInt)
    if not isinstance(floatDate, str) and not isinstance(floatDate, unicode):
        floatDate = str(floatDate)

    requestString.append("&floatDate=%s"%(floatDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquSharesFloatSubGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquSharesFloatSubGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'holdName', u'holdVol', u'publishDate', u'floatDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'holdName': 'str','holdVol': 'str','publishDate': 'str','floatDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HeyeNeeqGet(secID = "", ticker = "", listStatusCD = "", transWayCD = "", updateTimeBegin = "", updateTimeEnd = "", field = "", pandas = "1"):
    """
    获取新三板股票的基本信息，包含股票交易代码及其简称、股票类型、上市状态、上市板块、上市日期、曾用名等
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param listStatusCD: 挂牌状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,可空
    :param transWayCD: 转让方式代码。1-协议；3-竞价；4：意向；5：大宗交易。对应DataAPI.SysCodeGet.codeTypeID=90021。,可以是列表,可空
    :param updateTimeBegin: 更新时间,开始时间,输入格式"YYYY-MM-DDTHH:MM:SS",如"2016-12-31T00:00:00",可空
    :param updateTimeEnd: 更新时间,结束时间,输入格式"YYYY-MM-DDTHH:MM:SS",如"2016-12-31T00:00:00",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getHeyeNeeq.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    requestString.append("&transWayCD=")
    if hasattr(transWayCD,'__iter__') and not isinstance(transWayCD, str):
        if len(transWayCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = transWayCD
            requestString.append(None)
        else:
            requestString.append(','.join(transWayCD))
    else:
        requestString.append(transWayCD)
    if not isinstance(updateTimeBegin, str) and not isinstance(updateTimeBegin, unicode):
        updateTimeBegin = str(updateTimeBegin)

    requestString.append("&updateTimeBegin=%s"%(updateTimeBegin))
    if not isinstance(updateTimeEnd, str) and not isinstance(updateTimeEnd, unicode):
        updateTimeEnd = str(updateTimeEnd)

    requestString.append("&updateTimeEnd=%s"%(updateTimeEnd))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HeyeNeeqGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HeyeNeeqGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secFullName', u'secShortName', u'cnSpell', u'partyID', u'exCountryCD', u'transCurrCD', u'listStatusCD', u'listDate', u'delistDate', u'transWayCD', u'officeAddr', u'primeOperating', u'endDate', u'TShEquity', u'secShortNameChg', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secFullName': 'str','secShortName': 'str','cnSpell': 'str','exCountryCD': 'str','transCurrCD': 'str','listStatusCD': 'str','transWayCD': 'str','officeAddr': 'str','primeOperating': 'str','secShortNameChg': 'str','updateTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HeyeNeeqListGet(secID = "", ticker = "", listStatusCD = "", BfListStatusCD = "", createTimeBegin = "", createTimeEnd = "", updateTimeBegin = "", updateTimeEnd = "", field = "", pandas = "1"):
    """
    获取新三板股票的挂牌信息，包含股票挂牌状态，挂牌审核进程，及相关中介机构，公司基本信息等
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param listStatusCD: 挂牌状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,可空
    :param BfListStatusCD: 待挂牌状态。RE-待审核；PRE-待挂牌,可以是列表,可空
    :param createTimeBegin: 创建时间,开始时间,输入格式"YYYY-MM-DDTHH:MM:SS",如"2016-12-31T00:00:00",可空
    :param createTimeEnd: 创建时间,结束时间,输入格式"YYYY-MM-DDTHH:MM:SS",如"2016-12-31T00:00:00",可空
    :param updateTimeBegin: 更新时间,开始时间,输入格式"YYYY-MM-DDTHH:MM:SS",如"2016-12-31T00:00:00",可空
    :param updateTimeEnd: 更新时间,结束时间,输入格式"YYYY-MM-DDTHH:MM:SS",如"2016-12-31T00:00:00",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getHeyeNeeqList.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    requestString.append("&BfListStatusCD=")
    if hasattr(BfListStatusCD,'__iter__') and not isinstance(BfListStatusCD, str):
        if len(BfListStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = BfListStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(BfListStatusCD))
    else:
        requestString.append(BfListStatusCD)
    if not isinstance(createTimeBegin, str) and not isinstance(createTimeBegin, unicode):
        createTimeBegin = str(createTimeBegin)

    requestString.append("&createTimeBegin=%s"%(createTimeBegin))
    if not isinstance(createTimeEnd, str) and not isinstance(createTimeEnd, unicode):
        createTimeEnd = str(createTimeEnd)

    requestString.append("&createTimeEnd=%s"%(createTimeEnd))
    if not isinstance(updateTimeBegin, str) and not isinstance(updateTimeBegin, unicode):
        updateTimeBegin = str(updateTimeBegin)

    requestString.append("&updateTimeBegin=%s"%(updateTimeBegin))
    if not isinstance(updateTimeEnd, str) and not isinstance(updateTimeEnd, unicode):
        updateTimeEnd = str(updateTimeEnd)

    requestString.append("&updateTimeEnd=%s"%(updateTimeEnd))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HeyeNeeqListGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HeyeNeeqListGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'listStatusCD', u'listDate', u'BfListStatusCD', u'reviewRpog', u'sponBroker', u'accountFirm', u'LawFirm', u'partyFullName', u'partyFullNameEn', u'regDate', u'primeOperating', u'profile', u'regCap', u'regCapCurrCD', u'RegAddr', u'officeAddr', u'tel', u'fax', u'Email', u'website', u'createTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','listStatusCD': 'str','BfListStatusCD': 'str','reviewRpog': 'str','sponBroker': 'str','accountFirm': 'str','LawFirm': 'str','partyFullName': 'str','partyFullNameEn': 'str','primeOperating': 'str','profile': 'str','regCapCurrCD': 'str','RegAddr': 'str','officeAddr': 'str','tel': 'str','fax': 'str','Email': 'str','website': 'str','createTime': 'str','updateTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquInstShGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司机构持股数量，持股市值，流通比例，增减情况等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止时间(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止时间(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquInstSh.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquInstShGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquInstShGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'shInst', u'instType', u'holdVol', u'holdMarketValue', u'prptFloatStock', u'volChg', u'isNew']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shInst': 'str','instType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquHoldersNumGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取上市公司股东户数及户均持股数。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquHoldersNum.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquHoldersNumGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquHoldersNumGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'shNum', u'avgHoldNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquStockExchangeGet(mergedShortName = "", shortName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股票置换的相关信息，具体包括换股价以及相应的具体公告日期。
    
    :param mergedShortName: 换股方简称,可以是列表,可空
    :param shortName: 标的方简称,可以是列表,可空
    :param beginDate: 最新公告日(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 最新公告日(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquStockExchange.csv?ispandas=1&') 
    requestString.append("mergedShortName=")
    if hasattr(mergedShortName,'__iter__') and not isinstance(mergedShortName, str):
        if len(mergedShortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = mergedShortName
            requestString.append(None)
        else:
            requestString.append(','.join(mergedShortName))
    else:
        requestString.append(mergedShortName)
    requestString.append("&shortName=")
    if hasattr(shortName,'__iter__') and not isinstance(shortName, str):
        if len(shortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = shortName
            requestString.append(None)
        else:
            requestString.append(','.join(shortName))
    else:
        requestString.append(shortName)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquStockExchangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquStockExchangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'mergedStockID', u'mergedShortName', u'mergedStockPrice', u'stockID', u'shortName', u'stockPrice', u'baseDate', u'isOverallMarket', u'finConsultant', u'publishDate', u'exchangePlan', u'progressChg', u'proRemark', u'planPublishDate', u'planResumpTime', u'shcRecordBeginDate', u'shcRecordDate', u'shcRecordRetDate', u'sasacApprovalPublDate', u'mofcomApprovalPublDate', u'iecApprPubDate', u'effectDate', u'effectLastDate', u'recordDate', u'listPublishDate', u'listDate', u'optionBeginDate', u'optionEndDate', u'optionAccountDate', u'csrcApprPubDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'mergedShortName': 'str','stockID': 'str','shortName': 'str','finConsultant': 'str','exchangePlan': 'str','proRemark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquIpoAbnormalGet(secID = "", ticker = "", beginDate = "", endDate = "", issueType = "", field = "", pandas = "1"):
    """
    记录首发出现异常情况的代码信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param issueType: 事件类型,1-暂缓，2-失败，3-重启。对应DataAPI.SysCodeGet.codeTypeID=21002。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIpoAbnormal.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&issueType=")
    if hasattr(issueType,'__iter__') and not isinstance(issueType, str):
        if len(issueType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = issueType
            requestString.append(None)
        else:
            requestString.append(','.join(issueType))
    else:
        requestString.append(issueType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquIpoAbnormalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquIpoAbnormalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'issueType', u'remark', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquRelatedTrsfundGet(secID = "", ticker = "", pubBeginDate = "", pubEndDate = "", beginDate = "", endDate = "", relationType = "", accountType = "", field = "", pandas = "1"):
    """
    记录上市公司相关关联交易资金往来汇总情况
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param pubBeginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param pubEndDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param relationType: 关联方关系分类。例如：1-上市公司的母公司，2-上市公司的子公司，3-与上市公司受同一母公司控制的其他企业等。对应DataAPI.SysCodeGet.codeTypeID=21003。,可以是列表,可空
    :param accountType: 资金往来科目分类。例如：1-应收资金类，2-应付资金类，3-应收账款类等。对应DataAPI.SysCodeGet.codeTypeID=21004。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRelatedTrsfund.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        pubBeginDate = pubBeginDate.strftime('%Y%m%d')
    except:
        pubBeginDate = pubBeginDate.replace('-', '')
    requestString.append("&pubBeginDate=%s"%(pubBeginDate))
    try:
        pubEndDate = pubEndDate.strftime('%Y%m%d')
    except:
        pubEndDate = pubEndDate.replace('-', '')
    requestString.append("&pubEndDate=%s"%(pubEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&relationType=")
    if hasattr(relationType,'__iter__') and not isinstance(relationType, str):
        if len(relationType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = relationType
            requestString.append(None)
        else:
            requestString.append(','.join(relationType))
    else:
        requestString.append(relationType)
    requestString.append("&accountType=")
    if hasattr(accountType,'__iter__') and not isinstance(accountType, str):
        if len(accountType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = accountType
            requestString.append(None)
        else:
            requestString.append(','.join(accountType))
    else:
        requestString.append(accountType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquRelatedTrsfundGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquRelatedTrsfundGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'relatedPartyName', u'relationType', u'connectionRelation', u'accountType', u'account', u'transaRank', u'begBanlance', u'endBanlance', u'endBanratio', u'currencyCode', u'remark', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','relatedPartyName': 'str','connectionRelation': 'str','account': 'str','transaRank': 'str','currencyCode': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquManageStrucGet(secID = "", ticker = "", beginDate = "", endDate = "", reportType = "", field = "", pandas = "1"):
    """
    记录公司组织构架情况，包含员工离退休信息，董事会、监事会和高管人员情况（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param reportType: 公告类型。例如：1-董事会决议公告，2-股东大会决议公告，3-临时公告等。对应DataAPI.SysCodeGet.codeTypeID=20091。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquManageStruc.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&reportType=")
    if hasattr(reportType,'__iter__') and not isinstance(reportType, str):
        if len(reportType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportType
            requestString.append(None)
        else:
            requestString.append(','.join(reportType))
    else:
        requestString.append(reportType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquManageStrucGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquManageStrucGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'reportType', u'staffNum', u'retiredNum', u'commiNum', u'direNum', u'indeDireNum', u'femalDireNum', u'supervisorNum', u'staffSupervisNum', u'executiveNum', u'sumManaNum', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','staffNum': 'str','retiredNum': 'str','commiNum': 'str','direNum': 'str','indeDireNum': 'str','femalDireNum': 'str','supervisorNum': 'str','staffSupervisNum': 'str','executiveNum': 'str','sumManaNum': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquManageExcitGet(secID = "", ticker = "", beginDate = "", endDate = "", exerciseBeginDate = "", exerciseEndDate = "", progress = "", subjectID = "", reasonID = "", field = "", pandas = "1"):
    """
    记录上市公司高管激励情况，包含各阶段的激励情况及行权情况等。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param exerciseBeginDate: 行权或解锁日期(起始)，输入格式“YYYYMMDD”,可空
    :param exerciseEndDate: 行权或解锁日期(截止)，输入格式“YYYYMMDD”,可空
    :param progress: 方案进程。例如：1-预案，2-实施，3-完成等。对应DataAPI.SysCodeGet.codeTypeID=20118。,可以是列表,可空
    :param subjectID: 激励标的物编码。例如：1-股票期权，2-限制性股票，3-股票增值权等。对应DataAPI.SysCodeGet.codeTypeID=20119。,可以是列表,可空
    :param reasonID: 未行权或解锁原因。例如：1-未达到行权或解锁期，2-行权或解锁期已离职，3-未达到行权或解锁条件等。对应DataAPI.SysCodeGet.codeTypeID=20120。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquManageExcit.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        exerciseBeginDate = exerciseBeginDate.strftime('%Y%m%d')
    except:
        exerciseBeginDate = exerciseBeginDate.replace('-', '')
    requestString.append("&exerciseBeginDate=%s"%(exerciseBeginDate))
    try:
        exerciseEndDate = exerciseEndDate.strftime('%Y%m%d')
    except:
        exerciseEndDate = exerciseEndDate.replace('-', '')
    requestString.append("&exerciseEndDate=%s"%(exerciseEndDate))
    requestString.append("&progress=")
    if hasattr(progress,'__iter__') and not isinstance(progress, str):
        if len(progress) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = progress
            requestString.append(None)
        else:
            requestString.append(','.join(progress))
    else:
        requestString.append(progress)
    requestString.append("&subjectID=")
    if hasattr(subjectID,'__iter__') and not isinstance(subjectID, str):
        if len(subjectID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = subjectID
            requestString.append(None)
        else:
            requestString.append(','.join(subjectID))
    else:
        requestString.append(subjectID)
    requestString.append("&reasonID=")
    if hasattr(reasonID,'__iter__') and not isinstance(reasonID, str):
        if len(reasonID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reasonID
            requestString.append(None)
        else:
            requestString.append(','.join(reasonID))
    else:
        requestString.append(reasonID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquManageExcitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquManageExcitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'progress', u'managerName', u'position', u'implePhase', u'subjectID', u'obtainShares', u'ratio', u'isExercise', u'reasonID', u'exerciseDate', u'exerciseNum', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','managerName': 'str','position': 'str','implePhase': 'str','subjectID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquDireComitGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录董事会下设专门委员会信息，包含委员会名称个数（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquDireComit.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquDireComitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquDireComitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'reportType', u'commiNum', u'commiNumName', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','commiNum': 'str','commiNumName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquNonGuatGet(secID = "", ticker = "", beginDate = "", endDate = "", guatrType = "", field = "", pandas = "1"):
    """
    记录非上市公司担保人担保情况
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param guatrType: 担保人类型。例如：1-自然人，2-一般法人，3-银行等。对应DataAPI.SysCodeGet.codeTypeID=21005。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquNonGuat.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&guatrType=")
    if hasattr(guatrType,'__iter__') and not isinstance(guatrType, str):
        if len(guatrType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = guatrType
            requestString.append(None)
        else:
            requestString.append(','.join(guatrType))
    else:
        requestString.append(guatrType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquNonGuatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquNonGuatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'guatrName', u'guatrType', u'guatrGuateType', u'guatrRelaType', u'guatType', u'guatSum', u'guatRatio', u'bookValue', u'markValue', u'infoID', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','guatrName': 'str','guatrType': 'str','guatrGuateType': 'str','guatrRelaType': 'str','guatType': 'str','infoID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquGuatGet(secID = "", ticker = "", beginDate = "", endDate = "", loanType = "", apprStatType = "", guatNatr = "", field = "", pandas = "1"):
    """
    记录上市公司对外担保情况相关详细信息，包括被担保人姓名、与公司关系、债权人具体信息、以及担保的期限和金额、担保性质类型等
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param loanType: 借款形式。例如，1-履约；2-未履约。对应DataAPI.SysCodeGet.codeTypeID=21008。,可以是列表,可空
    :param apprStatType: 审批状态类型。例如，1-董事会批准；2-股东大会批准。对应DataAPI.SysCodeGet.codeTypeID=21013。,可以是列表,可空
    :param guatNatr: 担保性质类型。例如，1-不可撤销担保；2-反担保，3-互保。对应DataAPI.SysCodeGet.codeTypeID=21011。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquGuat.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&loanType=")
    if hasattr(loanType,'__iter__') and not isinstance(loanType, str):
        if len(loanType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = loanType
            requestString.append(None)
        else:
            requestString.append(','.join(loanType))
    else:
        requestString.append(loanType)
    requestString.append("&apprStatType=")
    if hasattr(apprStatType,'__iter__') and not isinstance(apprStatType, str):
        if len(apprStatType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = apprStatType
            requestString.append(None)
        else:
            requestString.append(','.join(apprStatType))
    else:
        requestString.append(apprStatType)
    requestString.append("&guatNatr=")
    if hasattr(guatNatr,'__iter__') and not isinstance(guatNatr, str):
        if len(guatNatr) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = guatNatr
            requestString.append(None)
        else:
            requestString.append(','.join(guatNatr))
    else:
        requestString.append(guatNatr)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquGuatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquGuatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'currencyCD', u'guateName', u'guateRelaType', u'guateIsList', u'credType', u'credName', u'credGuateType', u'credRelaType', u'loanType', u'loanSum', u'singDate', u'startDate', u'endDate', u'guatTerm', u'apprStatType', u'apprDate', u'guatType', u'guatSum', u'term', u'pledName', u'pledUse', u'bookValue', u'markValue', u'ratio', u'guatNatr', u'isStriGuar']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','currencyCD': 'str','guateName': 'str','guateRelaType': 'str','guateIsList': 'str','credType': 'str','credName': 'str','credGuateType': 'str','credRelaType': 'str','loanType': 'str','guatTerm': 'str','apprStatType': 'str','guatType': 'str','term': 'str','pledName': 'str','pledUse': 'str','guatNatr': 'str','isStriGuar': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquAgencyGet(secID = "", ticker = "", beginDate = "", endDate = "", eventType = "", agentType = "", field = "", pandas = "1"):
    """
    记录上市公司融资事件中中介机构情况信息，包括中介机构类型、机构名称和经办人姓名等信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 发行起始日(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 发行起始日(截止)，输入格式“YYYYMMDD”,可空
    :param eventType: 事件类型。例如，10-定向增发；20-公开增发；30-首发；40-配股。对应DataAPI.SysCodeGet.codeTypeID=20110。,可以是列表,可空
    :param agentType: 中介机构类别。例如，01-上市推荐人；02-发行协调人；03-会计师事务所；04-律师事务所等。对应DataAPI.SysCodeGet.codeTypeID=21015。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquAgency.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&eventType=")
    if hasattr(eventType,'__iter__') and not isinstance(eventType, str):
        if len(eventType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventType
            requestString.append(None)
        else:
            requestString.append(','.join(eventType))
    else:
        requestString.append(eventType)
    requestString.append("&agentType=")
    if hasattr(agentType,'__iter__') and not isinstance(agentType, str):
        if len(agentType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = agentType
            requestString.append(None)
        else:
            requestString.append(','.join(agentType))
    else:
        requestString.append(agentType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquAgencyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquAgencyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'eventID', u'eventType', u'issueBeginDate', u'agentType', u'agentName', u'agencyName', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','eventID': 'str','eventType': 'str','agentType': 'str','agentName': 'str','agencyName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquIpoDclrGet(secID = "", ticker = "", beginDate = "", endDate = "", dclrState = "", typeName = "", field = "", pandas = "1"):
    """
    记录A股首发相关申报企业详细信息，包括信息发布日期、拟上市地、保荐人、会计师、律师等信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 信息发布日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 信息发布日期(截止)，输入格式“YYYYMMDD”,可空
    :param dclrState: 申报状态。例如，1-初审中；2-落实反馈意见；3-已预披露中。对应DataAPI.SysCodeGet.codeTypeID=21018。,可以是列表,可空
    :param typeName: 所属板块。例如，1-创业板；2-主板和中小企业板；3-科创板。对应DataAPI.SysCodeGet.codeTypeID=21016。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIpoDclr.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&dclrState=")
    if hasattr(dclrState,'__iter__') and not isinstance(dclrState, str):
        if len(dclrState) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dclrState
            requestString.append(None)
        else:
            requestString.append(','.join(dclrState))
    else:
        requestString.append(dclrState)
    requestString.append("&typeName=")
    if hasattr(typeName,'__iter__') and not isinstance(typeName, str):
        if len(typeName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeName
            requestString.append(None)
        else:
            requestString.append(','.join(typeName))
    else:
        requestString.append(typeName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquIpoDclrGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquIpoDclrGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'infoSource', u'publishDate', u'endDate', u'typeName', u'sponsor', u'sponsorReg', u'auditAgency', u'auditSign', u'lawFirm', u'lawSign', u'dclrState', u'endExmtDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','sponsor': 'str','sponsorReg': 'str','auditAgency': 'str','auditSign': 'str','lawFirm': 'str','lawSign': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpequsharesfloatinstGet(secID = "", ticker = "", beginDate = "", endDate = "", typeID = "", shareProperty = "", field = "", pandas = "1"):
    """
    记录不同行业限售解禁统计数据（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 流通日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 流通日期(截止)，输入格式“YYYYMMDD”,可空
    :param typeID: 行业ID。例如，010303-申万行业分类2014版；01030301-农林牧渔；0103030101-种植业等。对应DataAPI.SysCodeGet.codeTypeID=10022。,可以是列表,可空
    :param shareProperty: 限售流通股份性质。例如，1-定向增发机构配售股份；2-公开增发机构配售股份；3-公开增发一般股份等。对应DataAPI.SysCodeGet.codeTypeID=20108。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpequsharesfloatinst.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&shareProperty=")
    if hasattr(shareProperty,'__iter__') and not isinstance(shareProperty, str):
        if len(shareProperty) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = shareProperty
            requestString.append(None)
        else:
            requestString.append(','.join(shareProperty))
    else:
        requestString.append(shareProperty)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpequsharesfloatinstGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpequsharesfloatinstGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'publishDate', u'floatDate', u'floatNum', u'shareProperty', u'typeID', u'partyID', u'intoDate', u'outDate', u'industry', u'industryVersion', u'industryLevel']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','shareProperty': 'str','typeID': 'str','industry': 'str','industryVersion': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpfstdetailinstGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录不同行业两融余额统计数据。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 信息发布日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 信息发布日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRrpfstdetailinst.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpfstdetailinstGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpfstdetailinstGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'tradeDate', u'tradeVal', u'partyID', u'typeID', u'intoDate', u'outDate', u'typeName', u'parentID', u'industry', u'industryVersion', u'industryLevel']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','typeID': 'str','typeName': 'str','parentID': 'str','industry': 'str','industryVersion': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EquPredicmGet(beginPredictionDate = "", endPredictionDate = "", beginTargetDate = "", endTargetDate = "", predValue = "", predResult = "", predResultStrength = "", field = "", pandas = "1"):
    """
    沪深300月度预测模型结果，包括发出预测日期，预测截止日期，收益预测概率，收益率预测结果，盘面强弱预测结果等信息。
    
    :param beginPredictionDate: 发出预测开始日期,可空
    :param endPredictionDate: 发出预测结束日期,可空
    :param beginTargetDate: 预测截至开始日期,可空
    :param endTargetDate: 预测截至结束日期,可空
    :param predValue: 收益率预测概率,可空
    :param predResult: 1:涨，0:跌,可以是列表,可空
    :param predResultStrength: 0:震荡,1:看涨,-1:下跌,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquPredicm.csv?ispandas=1&') 
    try:
        beginPredictionDate = beginPredictionDate.strftime('%Y%m%d')
    except:
        beginPredictionDate = beginPredictionDate.replace('-', '')
    requestString.append("beginPredictionDate=%s"%(beginPredictionDate))
    try:
        endPredictionDate = endPredictionDate.strftime('%Y%m%d')
    except:
        endPredictionDate = endPredictionDate.replace('-', '')
    requestString.append("&endPredictionDate=%s"%(endPredictionDate))
    try:
        beginTargetDate = beginTargetDate.strftime('%Y%m%d')
    except:
        beginTargetDate = beginTargetDate.replace('-', '')
    requestString.append("&beginTargetDate=%s"%(beginTargetDate))
    try:
        endTargetDate = endTargetDate.strftime('%Y%m%d')
    except:
        endTargetDate = endTargetDate.replace('-', '')
    requestString.append("&endTargetDate=%s"%(endTargetDate))
    if not isinstance(predValue, str) and not isinstance(predValue, unicode):
        predValue = str(predValue)

    requestString.append("&predValue=%s"%(predValue))
    requestString.append("&predResult=")
    if hasattr(predResult,'__iter__') and not isinstance(predResult, str):
        if len(predResult) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = predResult
            requestString.append(None)
        else:
            requestString.append(','.join(predResult))
    else:
        requestString.append(predResult)
    requestString.append("&predResultStrength=")
    if hasattr(predResultStrength,'__iter__') and not isinstance(predResultStrength, str):
        if len(predResultStrength) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = predResultStrength
            requestString.append(None)
        else:
            requestString.append(','.join(predResultStrength))
    else:
        requestString.append(predResultStrength)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EquPredicmGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EquPredicmGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'predictionDate', u'targetDate', u'predValue', u'predResult', u'predResultStrength']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquGet(secID = "", ticker = "", equTypeCD = "", listStatusCD = "", exchangeCD = "", ListSectorCD = "", field = "", pandas = "1"):
    """
    获取股票的基本信息，包含股票交易代码及其简称、股票类型、上市状态、上市板块、上市日期等；上市状态为最新数据，不显示历史变动信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、equTypeCD至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,secID、ticker、equTypeCD至少选择一个
    :param equTypeCD: 股票分类编码。例如，A-A股；B-B股。,可以是列表,secID、ticker、equTypeCD至少选择一个
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,可空
    :param exchangeCD: 交易市场。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。对应DataAPI.SysCodeGet.codeTypeID=10002。,可空
    :param ListSectorCD: 上市板块编码。1-主板；2-创业板；3-中小板；4-科创板。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEqu.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&equTypeCD=")
    if hasattr(equTypeCD,'__iter__') and not isinstance(equTypeCD, str):
        if len(equTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = equTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(equTypeCD))
    else:
        requestString.append(equTypeCD)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&ListSectorCD=")
    if hasattr(ListSectorCD,'__iter__') and not isinstance(ListSectorCD, str):
        if len(ListSectorCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ListSectorCD
            requestString.append(None)
        else:
            requestString.append(','.join(ListSectorCD))
    else:
        requestString.append(ListSectorCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'ListSectorCD', u'ListSector', u'transCurrCD', u'secShortName', u'secFullName', u'listStatusCD', u'listDate', u'delistDate', u'equTypeCD', u'equType', u'exCountryCD', u'partyID', u'totalShares', u'nonrestFloatShares', u'nonrestfloatA', u'officeAddr', u'primeOperating', u'endDate', u'TShEquity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','ListSector': 'str','transCurrCD': 'str','secShortName': 'str','secFullName': 'str','listStatusCD': 'str','equTypeCD': 'str','equType': 'str','exCountryCD': 'str','officeAddr': 'str','primeOperating': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquAllotGet(secID = "", ticker = "", isAllotment = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票历次配股的基本信息，包含每次配股方案的内容、方案进度、历史配股预案公布次数以及最终是否配股成功。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、isAllotment至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,secID、ticker、isAllotment至少选择一个
    :param isAllotment: 是否最终配股成功，0-不成功，1-成功。,可以是列表,secID、ticker、isAllotment至少选择一个
    :param beginDate: 配股预案的起始公布日期，输入格式“YYYYMMDD”,可空
    :param endDate: 配股预案的结束公布日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquAllot.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&isAllotment=")
    if hasattr(isAllotment,'__iter__') and not isinstance(isAllotment, str):
        if len(isAllotment) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isAllotment
            requestString.append(None)
        else:
            requestString.append(','.join(isAllotment))
    else:
        requestString.append(isAllotment)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquAllotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquAllotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'publishDate', u'isAllotment', u'equType', u'allotmentRatio', u'allotmentPrice', u'currencyCD', u'allotFrPrice', u'frCurrencyCD', u'recordDate', u'exRightsDate', u'payBeginDate', u'payEndDate', u'listDate', u'allotShares', u'sharesBfAllot', u'sharesAfAllot']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','equType': 'str','currencyCD': 'str','frCurrencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquDivGet(secID = "", ticker = "", eventProcessCD = "", exDivDate = "", beginDate = "", endDate = "", beginPublishDate = "", endPublishDate = "", beginRecordDate = "", endRecordDate = "", field = "", pandas = "1"):
    """
    获取股票历次分红(派现、送股、转增股)的基本信息，包含历次分红预案的内容、实施进展情况以及历史宣告分红次数。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、eventProcessCD、exDivDate至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,secID、ticker、eventProcessCD、exDivDate至少选择一个
    :param eventProcessCD: 事件进程。例如，1-董事预案；3-股东大会否决。对应DataAPI.SysCodeGet.codeTypeID=20001。,可以是列表,secID、ticker、eventProcessCD、exDivDate至少选择一个
    :param exDivDate: 输入一个日期，格式“YYYYMMDD”，可以获取到这个输入日期当天的除权分红信息,secID、ticker、eventProcessCD、exDivDate至少选择一个
    :param beginDate: 本次分红所属的财政年度、财政半年度、财政季度的最后一个自然日，输入格式“YYYYMMDD”，如输入起始日期‘20130101’，截止日期‘20131231’，可以查询到2013年期间所有分红,可空
    :param endDate: 本次分红所属的财政年度、财政半年度、财政季度的最后一个自然日，输入格式“YYYYMMDD”，如输入起始日期‘20130101’，截止日期‘20131231’，可以查询到2013年期间所有分红,可空
    :param beginPublishDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endPublishDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param beginRecordDate: 股权登记日(起始)，输入格式“YYYYMMDD”,可空
    :param endRecordDate: 股权登记日(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquDiv.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&eventProcessCD=")
    if hasattr(eventProcessCD,'__iter__') and not isinstance(eventProcessCD, str):
        if len(eventProcessCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventProcessCD
            requestString.append(None)
        else:
            requestString.append(','.join(eventProcessCD))
    else:
        requestString.append(eventProcessCD)
    try:
        exDivDate = exDivDate.strftime('%Y%m%d')
    except:
        exDivDate = exDivDate.replace('-', '')
    requestString.append("&exDivDate=%s"%(exDivDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginPublishDate = beginPublishDate.strftime('%Y%m%d')
    except:
        beginPublishDate = beginPublishDate.replace('-', '')
    requestString.append("&beginPublishDate=%s"%(beginPublishDate))
    try:
        endPublishDate = endPublishDate.strftime('%Y%m%d')
    except:
        endPublishDate = endPublishDate.replace('-', '')
    requestString.append("&endPublishDate=%s"%(endPublishDate))
    try:
        beginRecordDate = beginRecordDate.strftime('%Y%m%d')
    except:
        beginRecordDate = beginRecordDate.replace('-', '')
    requestString.append("&beginRecordDate=%s"%(beginRecordDate))
    try:
        endRecordDate = endRecordDate.strftime('%Y%m%d')
    except:
        endRecordDate = endRecordDate.replace('-', '')
    requestString.append("&endRecordDate=%s"%(endRecordDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquDivGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquDivGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'endDate', u'publishDate', u'eventProcessCD', u'perShareDivRatio', u'perShareTransRatio', u'perCashDiv', u'perCashDivAfTax', u'currencyCD', u'frPerCashDiv', u'frPerCashDivAfTax', u'frCurrencyCD', u'recordDate', u'exDivDate', u'bLastTradeDate', u'payCashDate', u'bonusShareListDate', u'ftdAfExdiv', u'sharesBfDiv', u'sharesAfDiv']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','currencyCD': 'str','frCurrencyCD': 'str','ftdAfExdiv': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIndustryGet(secID = "", ticker = "", industryVersionCD = "", industry = "", industryID = "", industryID1 = "", industryID2 = "", industryID3 = "", intoDate = "", equTypeID = "", field = "", pandas = "1"):
    """
    获取沪深股票所属行业的进出记录，包含行业分类标准、股票代码、行业编码、纳入日期、剔除日期、是否最新等（含科创板）。行业分类标准目前提供：证监会行业；申万行业；中信行业；中证行业；恒生行业；战略性新兴产业。行业分类之间的层级关系可使用getIndustry查看。
    
    :param secID: 通联编制的证券编码，可在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、industryVersionCD、industry、industryID至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、industryVersionCD、industry、industryID至少选择一个
    :param industryVersionCD: 行业分类标准数字编码，建议用此参数确定行业类别，010301-证监会行业V2012；010303-申万行业分类；010306-恒生行业；010314-中证行业分类（2016版）；010317-中信行业分类；010319-战略性新兴产业(2018),secID、ticker、industryVersionCD、industry、industryID至少选择一个
    :param industry: 行业分类标准名称，可模糊查询,secID、ticker、industryVersionCD、industry、industryID至少选择一个
    :param industryID: 通联编制的行业分类编码，可以通过getIndustry获取。,secID、ticker、industryVersionCD、industry、industryID至少选择一个
    :param industryID1: 一级行业编码,可以是列表,可空
    :param industryID2: 二级行业编码,可以是列表,可空
    :param industryID3: 三级行业编码,可以是列表,可空
    :param intoDate: 输入日期，可以获取这一天股票所属行业信息，输入格式“YYYYMMDD”,可空
    :param equTypeID: 股票类型代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIndustry.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(industryVersionCD, str) and not isinstance(industryVersionCD, unicode):
        industryVersionCD = str(industryVersionCD)

    requestString.append("&industryVersionCD=%s"%(industryVersionCD))
    if not isinstance(industry, str) and not isinstance(industry, unicode):
        industry = str(industry)

    requestString.append("&industry=%s"%(industry))
    if not isinstance(industryID, str) and not isinstance(industryID, unicode):
        industryID = str(industryID)

    requestString.append("&industryID=%s"%(industryID))
    requestString.append("&industryID1=")
    if hasattr(industryID1,'__iter__') and not isinstance(industryID1, str):
        if len(industryID1) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID1
            requestString.append(None)
        else:
            requestString.append(','.join(industryID1))
    else:
        requestString.append(industryID1)
    requestString.append("&industryID2=")
    if hasattr(industryID2,'__iter__') and not isinstance(industryID2, str):
        if len(industryID2) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID2
            requestString.append(None)
        else:
            requestString.append(','.join(industryID2))
    else:
        requestString.append(industryID2)
    requestString.append("&industryID3=")
    if hasattr(industryID3,'__iter__') and not isinstance(industryID3, str):
        if len(industryID3) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID3
            requestString.append(None)
        else:
            requestString.append(','.join(industryID3))
    else:
        requestString.append(industryID3)
    try:
        intoDate = intoDate.strftime('%Y%m%d')
    except:
        intoDate = intoDate.replace('-', '')
    requestString.append("&intoDate=%s"%(intoDate))
    requestString.append("&equTypeID=")
    if hasattr(equTypeID,'__iter__') and not isinstance(equTypeID, str):
        if len(equTypeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = equTypeID
            requestString.append(None)
        else:
            requestString.append(','.join(equTypeID))
    else:
        requestString.append(equTypeID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIndustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIndustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secFullName', u'partyID', u'industryVersionCD', u'industry', u'industryID', u'industrySymbol', u'intoDate', u'outDate', u'isNew', u'industryID1', u'industryName1', u'industryID2', u'industryName2', u'industryID3', u'industryName3', u'IndustryID4', u'IndustryName4', u'equType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secFullName': 'str','industryVersionCD': 'str','industry': 'str','industryID': 'str','industrySymbol': 'str','industryID1': 'str','industryName1': 'str','industryID2': 'str','industryName2': 'str','industryID3': 'str','industryName3': 'str','IndustryID4': 'str','IndustryName4': 'str','equType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIPOGet(secID = "", ticker = "", eventProcessCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票首次公开发行上市的基本信息，包含股票首次公开发行的进程及发行结果（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、eventProcessCD至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,secID、ticker、eventProcessCD至少选择一个
    :param eventProcessCD: 发行进程。例如，9-上市；10-撤销上市。对应DataAPI.SysCodeGet.codeTypeID=20001。,可以是列表,secID、ticker、eventProcessCD至少选择一个
    :param beginDate: 上市日期起始日期，可空，输入格式“YYYYMMDD”,可空
    :param endDate: 上市日期截止日期，可空，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIPO.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&eventProcessCD=")
    if hasattr(eventProcessCD,'__iter__') and not isinstance(eventProcessCD, str):
        if len(eventProcessCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventProcessCD
            requestString.append(None)
        else:
            requestString.append(','.join(eventProcessCD))
    else:
        requestString.append(eventProcessCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIPOGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIPOGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'publishDate', u'eventProcessCD', u'onlineIssueDate', u'listDate', u'issuePrice', u'currencyCD', u'issueShares', u'onlineIssueShares', u'offlineIssueShares', u'newIssueShares', u'transShares', u'newIssueRaiseCap', u'OldShareRaiseCap', u'issuePE', u'onlineIssueLottoRatio', u'onlineIssueCode', u'firstDayOpenPrice', u'firstDayClosePrice', u'onlineSubMax', u'onlineSubMin']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','currencyCD': 'str','transShares': 'str','onlineIssueCode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRefGet(secID = "", ticker = "", beginDate = "", endDate = "", eventProcessCD = "", field = "", pandas = "1"):
    """
    获取股票股权分置改革的基本信息，包含股改进程、股改实施方案以及流通股的变动情况。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 股权分置改革方案公告日期，可以选择某一固定日期或者某一区间日期，输入格式“YYYYMMDD”,可空
    :param endDate: 股权分置改革方案公告日期，可以选择某一固定日期或者某一区间日期，输入格式“YYYYMMDD”,可空
    :param eventProcessCD: 事件进程。例如，1-董事会预案；2-股东大会通过；3-股东大会否决。对应DataAPI.SysCodeGet.codeTypeID=20001。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRef.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&eventProcessCD=")
    if hasattr(eventProcessCD,'__iter__') and not isinstance(eventProcessCD, str):
        if len(eventProcessCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventProcessCD
            requestString.append(None)
        else:
            requestString.append(','.join(eventProcessCD))
    else:
        requestString.append(eventProcessCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRefGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRefGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'publishDate', u'eventProcessCD', u'perShareDivRatio', u'perShareTransRatio', u'perCashDiv', u'currencyCD', u'recordDate', u'afFirstTradeDate', u'bfShares', u'afShares', u'bfTradeShares', u'bfTradeSharesRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRetudGet(secID = "", ticker = "", listStatusCD = "", beginDate = "", endDate = "", dailyReturnNoReinvLower = "", dailyReturnNoReinvUpper = "", dailyReturnReinvLower = "", dailyReturnReinvUpper = "", isChgPctl = "", field = "", pandas = "1"):
    """
    获取股票每日回报率的基本信息，包含交易当天的上市状态、日行情以及除权除息事项的基本数据（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、listStatusCD至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、listStatusCD至少选择一个
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,secID、ticker、listStatusCD至少选择一个
    :param beginDate: 根据交易日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据交易日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param dailyReturnNoReinvLower: 根据不考虑红利再投资的日回报率范围查询的开始值,可空
    :param dailyReturnNoReinvUpper: 根据不考虑红利再投资的日回报率范围查询的结束值,可空
    :param dailyReturnReinvLower: 根据考虑红利再投资的日回报率范围查询的开始值,可空
    :param dailyReturnReinvUpper: 根据考虑红利再投资的日回报率范围查询的结束值,可空
    :param isChgPctl: 是否涨跌幅限制。例如，0-设置涨跌幅限制，1-IPO(包括借壳重组上市)不设置涨跌幅限制，2-股改完成恢复交易首日不设置涨跌幅限制，3-交易所规定的交易当天不设置涨跌幅限制的其他情况。对应DataAPI.SysCodeGet.codeTypeID=20004。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRetud.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(dailyReturnNoReinvLower, str) and not isinstance(dailyReturnNoReinvLower, unicode):
        dailyReturnNoReinvLower = str(dailyReturnNoReinvLower)

    requestString.append("&dailyReturnNoReinvLower=%s"%(dailyReturnNoReinvLower))
    if not isinstance(dailyReturnNoReinvUpper, str) and not isinstance(dailyReturnNoReinvUpper, unicode):
        dailyReturnNoReinvUpper = str(dailyReturnNoReinvUpper)

    requestString.append("&dailyReturnNoReinvUpper=%s"%(dailyReturnNoReinvUpper))
    if not isinstance(dailyReturnReinvLower, str) and not isinstance(dailyReturnReinvLower, unicode):
        dailyReturnReinvLower = str(dailyReturnReinvLower)

    requestString.append("&dailyReturnReinvLower=%s"%(dailyReturnReinvLower))
    if not isinstance(dailyReturnReinvUpper, str) and not isinstance(dailyReturnReinvUpper, unicode):
        dailyReturnReinvUpper = str(dailyReturnReinvUpper)

    requestString.append("&dailyReturnReinvUpper=%s"%(dailyReturnReinvUpper))
    requestString.append("&isChgPctl=")
    if hasattr(isChgPctl,'__iter__') and not isinstance(isChgPctl, str):
        if len(isChgPctl) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isChgPctl
            requestString.append(None)
        else:
            requestString.append(','.join(isChgPctl))
    else:
        requestString.append(isChgPctl)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRetudGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRetudGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'tradeDate', u'listStatusCD', u'currencyCD', u'dailyReturnReinv', u'dailyReturnNoReinv', u'isChgPctl']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','listStatusCD': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSplitsGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取股票进行股本拆细或者缩股的基本信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 股票交易代码，如'000001',可以是列表,可空
    :param beginDate: 股本分拆方案公告日期，可以选择某一固定日期或者某一区间日期，输入格式“YYYYMMDD”,可空
    :param endDate: 股本分拆方案公告日期，可以选择某一固定日期或者某一区间日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSplits.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSplitsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSplitsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secshortName', u'publishDate', u'splitsRatio', u'splitsBaseDate', u'reTradeDate', u'sharesBfSplits', u'sharesAfSplits']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secshortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FstTotalGet(exchangeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取上海、深圳交易所公布的每个交易日的融资融券交易汇总的信息，包括成交量、成交金额。本交易日可获取前一交易日的数据。
    
    :param exchangeCD: 交易市场。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,可空
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getFstTotal.csv?ispandas=1&') 
    requestString.append("exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FstTotalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FstTotalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'exchangeCD', u'currencyCD', u'finVal', u'finBuyVal', u'secVol', u'secVal', u'secSellVol', u'tradeVal', u'finRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FstDetailGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取上海、深圳交易所公布的每个交易日的融资融券交易具体的信息，包括标的证券信息、融资融券金额以及数量方面的数据。本交易日可获取前一交易日的数据。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 交易代码，如'000001',可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getFstDetail.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FstDetailGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FstDetailGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'secID', u'ticker', u'assetClass', u'exchangeCD', u'secShortName', u'currencyCD', u'finVal', u'finBuyVal', u'finRefundVal', u'secVol', u'secSellVol', u'secRefundVol', u'secVal', u'tradeVal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','assetClass': 'str','exchangeCD': 'str','secShortName': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquShareGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取上市公司股本结构及历次股本变动数据（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票交易代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param partyID: 机构ID，法人统一编码，可通过法人名称在DataAPI.PartyIDGet获取到。,可以是列表,可空
    :param beginDate: 起始日期，默认为一年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，默认为当前日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShare.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquShareGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquShareGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'partyID', u'changeDate', u'totalShares', u'sharesA', u'sharesB', u'floatA', u'nonrestfloatA', u'floatB', u'restShares', u'nonrestFloatShares']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SecSTGet(beginDate, endDate, secID = "", ticker = "", field = "", pandas = "1"):
    """
    通过输入股票ID（通联编制）或股票交易代码（支持多值输入，最大支持50只），选择查询开始日期与结束日期，获取股票在一段时间ST标记信息。
    
    :param beginDate: 查询开始日期，输入格式“YYYYMMDD”
    :param endDate: 查询结束日期，输入格式“YYYYMMDD”
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 股票交易代码，如'000001'（可多值输入）,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getSecST.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SecSTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SecSTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'secID', u'ticker', u'exchangeCD', u'tradeAbbrName', u'STflg']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','tradeAbbrName': 'str','STflg': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSHHKConsGet(exchangeCD = "", intoDate = "", isNew = "", field = "", pandas = "1"):
    """
    获取沪港通合资格股票名单，包含调入日期、调出日期、是否最新等。交易所一般在生效日期之前发布调整信息，数据在发布后即更新。
    
    :param exchangeCD: 沪深港通交易方向代码,exchangeCD、intoDate、isNew至少选择一个
    :param intoDate: 输入日期，可以获取这一天沪港通合资格股票名单，输入格式“YYYYMMDD”,exchangeCD、intoDate、isNew至少选择一个
    :param isNew: 是否最新：1-是，0-否,exchangeCD、intoDate、isNew至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSHHKCons.csv?ispandas=1&') 
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("exchangeCD=%s"%(exchangeCD))
    try:
        intoDate = intoDate.strftime('%Y%m%d')
    except:
        intoDate = intoDate.replace('-', '')
    requestString.append("&intoDate=%s"%(intoDate))
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSHHKConsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSHHKConsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'secID', u'ticker', u'secShortName', u'secFullName', u'intoDate', u'outDate', u'isNew']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','secID': 'str','ticker': 'str','secShortName': 'str','secFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquShareFloatGet(secID = "", ticker = "", beginfloatDate = "", endfloatDate = "", field = "", pandas = "1"):
    """
    获取限售股解禁占股比例信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、beginfloatDate、endfloatDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginfloatDate、endfloatDate至少选择一个
    :param beginfloatDate: 起始流通日期，输入格式“YYYYMMDD”,secID、ticker、beginfloatDate、endfloatDate至少选择一个
    :param endfloatDate: 结束流通日期，输入格式“YYYYMMDD”,secID、ticker、beginfloatDate、endfloatDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShareFloat.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginfloatDate = beginfloatDate.strftime('%Y%m%d')
    except:
        beginfloatDate = beginfloatDate.replace('-', '')
    requestString.append("&beginfloatDate=%s"%(beginfloatDate))
    try:
        endfloatDate = endfloatDate.strftime('%Y%m%d')
    except:
        endfloatDate = endfloatDate.replace('-', '')
    requestString.append("&endfloatDate=%s"%(endfloatDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquShareFloatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquShareFloatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'floatDate', u'floatSharesNew', u'propOfFloat', u'propOfTotal', u'derestrictType', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str','derestrictType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIsActivityGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深市场A股机构调研统计，包括被调研机构代码与简称、调研日期、参与机构数量、披露日期等信息，不定时更新。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券交易代码，如'002642',可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 起始调研日期，格式为YYYYMMDD,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 截止调研日期，格式为YYYYMMDD,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIsActivity.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIsActivityGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIsActivityGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'eventID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'surveyDate', u'publishDate', u'partyNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'eventID': 'str','secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIsParticipantQaGet(secID = "", ticker = "", eventID = "", field = "", pandas = "1"):
    """
    获取沪深市场A股机构调研明细，包括被调研机构代码与简称、接待人员、参与调研的机构全称、调研机构类型、人员、调研内容等信息，不定时更新。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、eventID至少选择一个
    :param ticker: 证券交易代码，如'002642',可以是列表,secID、ticker、eventID至少选择一个
    :param eventID: 事件ID，可通过getEquIsActivity获取到。,可以是列表,secID、ticker、eventID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIsParticipantQa.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&eventID=")
    if hasattr(eventID,'__iter__') and not isinstance(eventID, str):
        if len(eventID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventID
            requestString.append(None)
        else:
            requestString.append(','.join(eventID))
    else:
        requestString.append(eventID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIsParticipantQaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIsParticipantQaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'eventID', u'secID', u'ticker', u'secShortName', u'partyName', u'partyType', u'activityType', u'participantName', u'receptionistName', u'location', u'centent']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'eventID': 'str','secID': 'str','ticker': 'str','secShortName': 'str','partyName': 'str','partyType': 'str','activityType': 'str','participantName': 'str','receptionistName': 'str','location': 'str','centent': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSpoGet(secID = "", ticker = "", beginListPublishDate = "", endListPublishDate = "", beginRecordDate = "", endRecordDate = "", beginDate = "", endDate = "", beginShcPublishDate = "", endShcPublishDate = "", beginListDate = "", endListDate = "", spoTypeCD = "", field = "", pandas = "1"):
    """
    历次增发方案以及实施信息，包括发行价、发行量、发行费用的相关信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,可空
    :param ticker: 证券交易代码,可以是列表,可空
    :param beginListPublishDate: 起始上市公告日，输入格式“YYYYMMDD”,可空
    :param endListPublishDate: 截止上市公告日，输入格式“YYYYMMDD”,可空
    :param beginRecordDate: 起始股权登记日，输入格式“YYYYMMDD”,可空
    :param endRecordDate: 截止股权登记日，输入格式“YYYYMMDD”,可空
    :param beginDate: 预案的起始公布日期，输入格式“YYYYMMDD”,可空
    :param endDate: 预案的结束公布日期，输入格式“YYYYMMDD”,可空
    :param beginShcPublishDate: 起始股东大会公告日，输入格式“YYYYMMDD”,可空
    :param endShcPublishDate: 截止股东大会公告日，输入格式“YYYYMMDD”,可空
    :param beginListDate: 起始增发股份上市日，输入格式“YYYYMMDD”,可空
    :param endListDate: 截止增发股份上市日，输入格式“YYYYMMDD”,可空
    :param spoTypeCD: 增发类型编码。例如，0101-公开增发；0102-非公开增发。对应DataAPI.SysCodeGet.codeTypeID=20019。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSpo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginListPublishDate = beginListPublishDate.strftime('%Y%m%d')
    except:
        beginListPublishDate = beginListPublishDate.replace('-', '')
    requestString.append("&beginListPublishDate=%s"%(beginListPublishDate))
    try:
        endListPublishDate = endListPublishDate.strftime('%Y%m%d')
    except:
        endListPublishDate = endListPublishDate.replace('-', '')
    requestString.append("&endListPublishDate=%s"%(endListPublishDate))
    try:
        beginRecordDate = beginRecordDate.strftime('%Y%m%d')
    except:
        beginRecordDate = beginRecordDate.replace('-', '')
    requestString.append("&beginRecordDate=%s"%(beginRecordDate))
    try:
        endRecordDate = endRecordDate.strftime('%Y%m%d')
    except:
        endRecordDate = endRecordDate.replace('-', '')
    requestString.append("&endRecordDate=%s"%(endRecordDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginShcPublishDate = beginShcPublishDate.strftime('%Y%m%d')
    except:
        beginShcPublishDate = beginShcPublishDate.replace('-', '')
    requestString.append("&beginShcPublishDate=%s"%(beginShcPublishDate))
    try:
        endShcPublishDate = endShcPublishDate.strftime('%Y%m%d')
    except:
        endShcPublishDate = endShcPublishDate.replace('-', '')
    requestString.append("&endShcPublishDate=%s"%(endShcPublishDate))
    try:
        beginListDate = beginListDate.strftime('%Y%m%d')
    except:
        beginListDate = beginListDate.replace('-', '')
    requestString.append("&beginListDate=%s"%(beginListDate))
    try:
        endListDate = endListDate.strftime('%Y%m%d')
    except:
        endListDate = endListDate.replace('-', '')
    requestString.append("&endListDate=%s"%(endListDate))
    requestString.append("&spoTypeCD=")
    if hasattr(spoTypeCD,'__iter__') and not isinstance(spoTypeCD, str):
        if len(spoTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = spoTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(spoTypeCD))
    else:
        requestString.append(spoTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSpoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSpoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secShortNameEn', u'planPublishDate', u'shcPublishDate', u'issuePricePul', u'issuePricePll', u'vldBeginDate', u'vldEndDate', u'changeTypeCD', u'changeType', u'spoTypeCD', u'spoType', u'equTypeCD', u'equType', u'listPublishDate', u'issueBeginDate', u'issueEndDate', u'recordDate', u'isExRights', u'exRightsDate', u'listDate', u'issuePrice', u'frIssuePrice', u'currencyCD', u'issueShares', u'issueRaiseCap', u'frIssueRaiseCap', u'issueCost', u'nIssueRaiseCap', u'nFrIssueRaiseCap', u'tradeShares', u'allotmentRatio', u'eventTypeCD', u'isEffTotalShare', u'publishDate', u'sasacResolDate', u'iecPublishDate', u'csrcPublishDate', u'issPublishDate', u'eventProcessCD', u'issuePriceDescription', u'priceBaseDate', u'priceBaseDateType', u'issVolPul', u'issVolPll', u'subsMode', u'priceModeCD', u'spoPurposeCD', u'planChanDes', u'issObj', u'isActContSub', u'isCovMainshare', u'issueRaiseCapPul', u'issueRaiseCapPll', u'capDes', u'mainParty', u'underWritingMethod', u'exmtDepartment', u'restPeriod', u'lshRestPeriod', u'allotmentShares', u'expListDate', u'actListDate', u'lshActListDate', u'lshExpListDate', u'expnIncome', u'lshApplyCD', u'infoID', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEn': 'str','changeTypeCD': 'str','changeType': 'str','spoTypeCD': 'str','spoType': 'str','equTypeCD': 'str','equType': 'str','currencyCD': 'str','eventTypeCD': 'str','eventProcessCD': 'str','issuePriceDescription': 'str','priceBaseDate': 'str','priceBaseDateType': 'str','subsMode': 'str','priceModeCD': 'str','spoPurposeCD': 'str','planChanDes': 'str','issObj': 'str','capDes': 'str','mainParty': 'str','exmtDepartment': 'str','lshApplyCD': 'str','infoID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquHolderChgCsfGet(secID = "", ticker = "", beginDate = "", shareholderName = "", endDate = "", field = "", pandas = "1"):
    """
    报告期证金汇金增减持
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、beginDate至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker、beginDate至少选择一个
    :param beginDate: 持股起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate至少选择一个
    :param shareholderName: 持股股东姓名,可空
    :param endDate: 持股截至日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquHolderChgCsf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(shareholderName, str) and not isinstance(shareholderName, unicode):
        shareholderName = str(shareholderName)

    requestString.append("&shareholderName=%s"%(shareholderName))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquHolderChgCsfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquHolderChgCsfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'partyID', u'shareholderName', u'endDateL', u'shareNumL', u'endDate', u'shareNum', u'holdType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','shareholderName': 'str','holdType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIpoPerformanceGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    IPO上市首日表现（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 股票上市日期，输入格式“YYYYMMDD”,可空
    :param endDate: 股票上市日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIpoPerformance.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIpoPerformanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIpoPerformanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'typeID', u'listDate', u'openPrice', u'highestPrice', u'lowestPrice', u'closePrice', u'turnoverVol', u'turnoverValue', u'PE', u'PB', u'turnoverRate', u'dailyReturnReinv', u'dailyReturnNoReinv']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','typeID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquPrivateFloatGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    主要记录股票非公开发行的信息
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 证券交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始预案公布日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截至预案公布日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquPrivateFloat.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquPrivateFloatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquPrivateFloatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'cnSpell', u'planPublishDate', u'shcPublishDate', u'issuePricePul', u'issuePricePll', u'vldBeginDate', u'vldEndDate', u'changeTypeCD', u'orgName', u'orgCode', u'validApplVol', u'placeVol', u'subsRatio', u'changeType', u'listPublishDate', u'issueBeginDate', u'issueEndDate', u'recordDate', u'isExRights', u'exRightsDate', u'listDate', u'issuePrice', u'frIssuePrice', u'currencyCD', u'issueShares', u'issueRaiseCap', u'frIssueRaiseCap', u'issueCost', u'nIssueRaiseCap', u'nFrIssueRaiseCap', u'tradeShares', u'allotmentRatio', u'limitPeriod', u'floatDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','cnSpell': 'str','changeTypeCD': 'str','orgName': 'str','orgCode': 'str','changeType': 'str','currencyCD': 'str','limitPeriod': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquChmIpoGet(secID = "", ticker = "", beginDate = "", endDate = "", listDate = "", field = "", pandas = "1"):
    """
    新股上市（含科创板）。
    
    :param secID: 证券代码,格式是“数字.交易所代码”，如000001.XSHE。,可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始上市日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止上市日期，输入格式“YYYYMMDD”,可空
    :param listDate: 上市日期，输入格式“YYYYMMDD”,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquChmIpo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&listDate=")
    if hasattr(listDate,'__iter__') and not isinstance(listDate, str):
        if len(listDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listDate
            requestString.append(None)
        else:
            requestString.append(','.join(listDate))
    else:
        requestString.append(listDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquChmIpoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquChmIpoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'listDate', u'secShortName', u'exchangeCD', u'issuePrice', u'exchangeName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','exchangeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSalaryRangeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    上市公司高管年薪所在的区间范围，以百万级区分。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始搜索范围的截止日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止搜索范围的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSalaryRange.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSalaryRangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSalaryRangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'endDate', u'intervalLevel', u'intervalNumber']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquShareEmployeesGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    上市公司员工情况，包括员工人数，员工学历和员工职位（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShareEmployees.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquShareEmployeesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquShareEmployeesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'holderName', u'infoType', u'typeValue', u'personNum', u'ratio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','infoType': 'str','typeValue': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquPartyNatureGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    个股企业性质，包含证券代码，证券简称，证券企业性质：国有、民营、外资等信息
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquPartyNature.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquPartyNatureGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquPartyNatureGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'cnSpell', u'secFullName', u'partyNatureCD', u'profile']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','cnSpell': 'str','secFullName': 'str','partyNatureCD': 'str','profile': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquMsChangesGet(secID = "", ticker = "", beginDate = "", endDate = "", fillDateBegin = "", fillDateEnd = "", field = "", pandas = "1"):
    """
    获取公司高管以及关系人持股变动记录，包含持股人与高管相关关系以及变动比例。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始变动日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止变动日期，输入格式“YYYYMMDD”,可空
    :param fillDateBegin: 起始填报日期，输入格式“YYYYMMDD”,可空
    :param fillDateEnd: 截止填报日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquMsChanges.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        fillDateBegin = fillDateBegin.strftime('%Y%m%d')
    except:
        fillDateBegin = fillDateBegin.replace('-', '')
    requestString.append("&fillDateBegin=%s"%(fillDateBegin))
    try:
        fillDateEnd = fillDateEnd.strftime('%Y%m%d')
    except:
        fillDateEnd = fillDateEnd.replace('-', '')
    requestString.append("&fillDateEnd=%s"%(fillDateEnd))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquMsChangesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquMsChangesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'cnSpell', u'managerName', u'position', u'holderName', u'relation', u'shareHoldBf', u'shareChanges', u'shareHoldAf', u'changeProp', u'avgPrice', u'changeReason', u'changeDate', u'fillDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','cnSpell': 'str','managerName': 'str','position': 'str','holderName': 'str','relation': 'str','changeReason': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSharesExcitGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    激励A股上市公司股权激励基本信息，包括激励价格、激励数量以及激励方式等相关数据。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始最新公告日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止最新公告日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSharesExcit.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSharesExcitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSharesExcitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'cnSpell', u'publishDate', u'advanceDate', u'eventChg', u'excitSubject', u'excitMode', u'excitShares', u'excitSharesPct', u'strikePrice', u'valPeriod', u'shcPublishDate', u'iniPublishDate', u'projRemark', u'priceRemark', u'excitSharesRemark', u'excitSharesCond', u'optionSpecCond']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','cnSpell': 'str','projRemark': 'str','priceRemark': 'str','excitSharesRemark': 'str','excitSharesCond': 'str','optionSpecCond': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSharesExcitDetGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股权激励的明细数据，涵盖激励方式，方案进度，激励标的物，每股转让价格，期权初始行权数量价格等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始最新公告日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止最新公告日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSharesExcitDet.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSharesExcitDetGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSharesExcitDetGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'progressChg', u'excitSubject', u'excitMode', u'excitShares', u'strikePrice', u'strikePriceBeg', u'optionSpecDate', u'extFundNum', u'isComplette']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','progressChg': 'str','excitSubject': 'str','excitMode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRestructuringGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司公告中公布的并购重组信息，包括资产收购、吸收合并、股权转让等相关类型的数据。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始最新日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止最新日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRestructuring.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRestructuringGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRestructuringGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'iniPublishDate', u'finPublishDate', u'program', u'isSucceed', u'restructuringType', u'underlyingType', u'underlyingVal', u'expenseVal', u'isRelevance', u'isMajorRes', u'payType', u'institNameB', u'relationShipB', u'institNameS', u'relationShipS', u'institNameSub', u'relationShipSub', u'institNameDeb', u'relationShipDeb', u'institNameCred', u'relationShipCred', u'outLine', u'finAdvistory', u'auditAgency', u'lawFirm', u'assessInstit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','program': 'str','restructuringType': 'str','underlyingType': 'str','payType': 'str','institNameB': 'str','relationShipB': 'str','institNameS': 'str','relationShipS': 'str','institNameSub': 'str','relationShipSub': 'str','institNameDeb': 'str','relationShipDeb': 'str','institNameCred': 'str','relationShipCred': 'str','outLine': 'str','finAdvistory': 'str','auditAgency': 'str','lawFirm': 'str','assessInstit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRestructuringSubGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录并购重组交易标的的相关信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始填报日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止变更日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRestructuringSub.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRestructuringSubGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRestructuringSubGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'iniPublishDate', u'finPublishDate', u'restructuringType', u'payType', u'institNameB', u'relationShipB', u'institNameS', u'relationShipS', u'institNameSub', u'relationShipSub', u'outLine', u'rank', u'underlyingName', u'ownerShip', u'property', u'volume', u'proportion', u'bookvalue', u'evaluationvalue', u'baseday', u'explanation', u'proportionBefB', u'proportionAftB', u'proportionBefS', u'proportionAftS']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','restructuringType': 'str','payType': 'str','institNameB': 'str','relationShipB': 'str','institNameS': 'str','relationShipS': 'str','institNameSub': 'str','relationShipSub': 'str','outLine': 'str','rank': 'str','underlyingName': 'str','ownerShip': 'str','property': 'str','explanation': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquCompIllegalGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市的各公司的违规明细，包括违规主体，处罚机构，违规类型，处罚金额等。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始公告日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止公告日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquCompIllegal.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquCompIllegalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquCompIllegalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'partyID', u'publishDate', u'lllegalType', u'lllegalSubject', u'adminobject', u'association', u'event', u'punishmentType', u'punishmentMeasure', u'punishmentUnit', u'punishmentAmount', u'relevantLaws']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','lllegalType': 'str','adminobject': 'str','event': 'str','punishmentType': 'str','punishmentMeasure': 'str','punishmentUnit': 'str','relevantLaws': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquPlacardsSubGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司被举牌的相关信息，包含股东名称，股东类型，变动日期，增持数量，占总股本比例等相关信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始公告日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止公告日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquPlacardsSub.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquPlacardsSubGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquPlacardsSubGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'shareholderName', u'shareholderType', u'shareholderActCon', u'beginDate', u'endDate', u'increasedNum', u'excitSharesPct', u'avgPrice', u'explanation', u'tSharesAf', u'tSharesAfRatio', u'isIncreased']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shareholderName': 'str','shareholderType': 'str','shareholderActCon': 'str','explanation': 'str','isIncreased': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquShTenGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取公司十大股东信息，包含持股数以及持股比例（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 以截止日期为基准的起始查询日期，输入格式“YYYYMMDD”,可空
    :param endDate: 以截止日期为基准的截止查询日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShTen.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquShTenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquShTenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'shNum', u'shName', u'holdVol', u'holdPct', u'shareType', u'updateTime', u'publishDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shName': 'str','shareType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIpoShareFloatGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司首次公开发行前股东股份解禁的相关信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期（起始），输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期（截至），输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIpoShareFloat.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIpoShareFloatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIpoShareFloatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'fullName', u'holdVol', u'listedDate', u'listedVol', u'remark']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','fullName': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquReformShareFloatGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录股改公司股份解禁的详细情况，包括解禁的数量明细与解禁时间等数据。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始有限售条件股份上市流通日，输入格式“YYYYMMDD”,可空
    :param endDate: 截至有限售条件股份上市流通日，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquReformShareFloat.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquReformShareFloatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquReformShareFloatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'floatDate', u'restShName', u'restFloatShares', u'listShares', u'excitSharesPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','restShName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRefDateGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录股改日期信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始股改日（区间起始），输入格式“YYYYMMDD”,可空
    :param endDate: 起始股改日（区间截止），输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRefDate.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRefDateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRefDateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'process', u'firSrDate', u'boRepDate', u'repTradeDate', u'sasAprDate', u'mcAprDate', u'hldMeetRegDate', u'shaSupStartDate', u'voteOptStartDate', u'voteOptEndDate', u'hldMeetStartDate', u'hldMeetEndDate', u'netwVoteStartDate', u'netwVoteEndDate', u'hldMeetDate', u'hldMeetPublDate', u'chanImplPublDate', u'equImplRegDate', u'implTradeDate', u'constStkTradeDate', u'constCashPayDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','process': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquFloatShTenGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取公司十大流通股东信息，包含持股数以及持股比例。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(开始日期），输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期（截止日期），输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquFloatShTen.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquFloatShTenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquFloatShTenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'publishDate', u'shNum', u'shName', u'holdVol', u'holdPct', u'shareType', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shName': 'str','shareType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSharesFloatGet(secID = "", ticker = "", beginFloatDate = "", endFloatDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司限售股流通时间、数量与股份性质等信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginFloatDate: 流通日期(开始日期），输入格式“YYYYMMDD”,可空
    :param endFloatDate: 流通日期(截止日期），输入格式“YYYYMMDD”,可空
    :param beginDate: 公告日期（开始日期），输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期（截止日期），输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSharesFloat.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginFloatDate = beginFloatDate.strftime('%Y%m%d')
    except:
        beginFloatDate = beginFloatDate.replace('-', '')
    requestString.append("&beginFloatDate=%s"%(beginFloatDate))
    try:
        endFloatDate = endFloatDate.strftime('%Y%m%d')
    except:
        endFloatDate = endFloatDate.replace('-', '')
    requestString.append("&endFloatDate=%s"%(endFloatDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSharesFloatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSharesFloatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'floatDate', u'floatNum', u'shareProperty']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shareProperty': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRefFloatTenGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录股改十大流通股东对价前后的持股数量以及参与投票的情况信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 股改完成日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 股改完成日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRefFloatTen.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRefFloatTenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRefFloatTenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'finDate', u'name', u'befMatcShares', u'befMatcPct', u'votNum', u'votStatus', u'aftMatcShares', u'aftMatcPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','name': 'str','votStatus': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquNationalTeamHoldGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录证金汇金持股情况，包含股东名称、持股数量及截至日期等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截至日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截至日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquNationalTeamHold.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquNationalTeamHoldGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquNationalTeamHoldGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'shareholderName', u'shareNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shareholderName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIpoUndernetDetGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录新股网下发行配售结果，申报企业名称、类型、获配数量等信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 发布日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 发布日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIpoUndernetDet.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIpoUndernetDetGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIpoUndernetDetGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'onlineIssueDate', u'orgName', u'orgType', u'investorsType', u'validApplVol', u'placeVol', u'refundAmount', u'limitPeriod']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','orgName': 'str','orgType': 'str','investorsType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquReportPrediscloGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录A股定期报告的预披露信息，包括定期报告变更披露的日期（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 预计披露日(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 预计披露日(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquReportPredisclo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquReportPrediscloGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquReportPrediscloGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'preDate', u'endDate', u'actDate', u'updateDate1', u'updateDate2', u'updateDate3']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquManagersGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取上市公司历届管理层信息，包括届次，职务，任期起始时间，任期结束时间等（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 离职日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 离职日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquManagers.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquManagersGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquManagersGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'managerName', u'managerType', u'session', u'position', u'beginDate', u'endDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','managerName': 'str','position': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquManagersInfoGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取上市公司管理层成员详细介绍，包括人员姓名、性别、出生年份、教育背景、详细介绍等信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquManagersInfo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquManagersInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquManagersInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'managerName', u'gender', u'birthday', u'education', u'nationality', u'backgroundDesc']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','managerName': 'str','gender': 'str','birthday': 'str','education': 'str','nationality': 'str','backgroundDesc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquExecsHoldingsGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司高管年度持股及薪酬方面的信息，包含高管基本信息，持股数量及关联方。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquExecsHoldings.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquExecsHoldingsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquExecsHoldingsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'name', u'position', u'annReward', u'subsidy', u'earHoldVol', u'endHoldVol', u'holdType', u'isPayPar', u'publishDate', u'reportType', u'isConcPosi', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','name': 'str','position': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquCommitteeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司委员会成员变动情况，包含委员会名称、成员名称及任职日期。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 任职公告日(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 任职公告日(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquCommittee.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquCommitteeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquCommitteeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'name', u'comName', u'position', u'accessionDate', u'dimissionDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','name': 'str','comName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquManageChgGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    董事长与总经理变更信息，包含变更类型、变更职位及教育背景等信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquManageChg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquManageChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquManageChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'reportType', u'changeDate', u'changePosition', u'actionType', u'name', u'secFullName', u'educationType', u'quitType', u'quitAge', u'officeYear', u'successionSource', u'isAgent', u'concurrentpost', u'resume', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','reportType': 'str','changePosition': 'str','actionType': 'str','name': 'str','secFullName': 'str','educationType': 'str','quitType': 'str','quitAge': 'str','officeYear': 'str','successionSource': 'str','isAgent': 'str','concurrentpost': 'str','resume': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquActualControllerGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司实际控制人信息，包含实际控制人、简介、控制权比例及关系说明（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquActualController.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquActualControllerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquActualControllerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'actContro', u'type', u'description', u'isEquContro', u'controlRadio', u'nonEquConNote', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','actContro': 'str','type': 'str','description': 'str','isEquContro': 'str','nonEquConNote': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquManagementConcurrentlyGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司高管在股东和其他单位任职情况。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquManagementConcurrently.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquManagementConcurrentlyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquManagementConcurrentlyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'name', u'partUnitName', u'partPosition', u'isReward', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','name': 'str','partUnitName': 'str','partPosition': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSalarySurGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录监管层薪酬的统计类信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSalarySur.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSalarySurGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSalarySurGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'sumSalary', u'sumSubsidy', u'sumSalTop3', u'sumSalDireTop3', u'paidNumDireTop3', u'sumSalManaTop3', u'paidNumManaTop3', u'unpaidNum', u'unpNumDire', u'unpNumSupe', u'sumSalMana', u'sumSalDire', u'sumSalSupe', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','endDate': 'str','sumSalManaTop3': 'str','unpaidNum': 'str','unpNumDire': 'str','unpNumSupe': 'str','sumSalMana': 'str','updateTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIndependentDirectorsVotingGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司独立董事参与会议的情况，包含独立董事姓名，应参加次数，委托出席次数，缺席次数等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIndependentDirectorsVoting.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIndependentDirectorsVotingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIndependentDirectorsVotingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'name', u'attendanceNum', u'entrustedAttNum', u'absNum', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','name': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIndependentOpinionGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司独立董事发表的意见。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIndependentOpinion.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIndependentOpinionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIndependentOpinionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'name', u'commentRank', u'eventCategory', u'commentContent', u'commentCategory', u'rank', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','name': 'str','eventCategory': 'str','commentContent': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquMeetInforGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司董事会、监事会、股东大会在年度内累计开会次数等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquMeetInfor.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquMeetInforGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquMeetInforGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'directorNum', u'supervisorNum', u'shareholderNum', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquProfitPredictionGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司预测年度主要财务指标。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 预测年度(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 预测年度(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquProfitPrediction.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquProfitPredictionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquProfitPredictionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'eventID', u'eventTypeCD', u'forecastYear', u'revenue', u'cogs', u'sellExp', u'adminExp', u'finanExp', u'operateProfit', u'investIncome', u'tProfit', u'incomeTax', u'nIncome', u'nIncomeAttrP', u'basicEps', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','eventID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIpoOverallotGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市A、B股绿鞋操作的实施状况。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIpoOverallot.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIpoOverallotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIpoOverallotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'stockType', u'publishDate', u'endDate', u'avgPirce', u'shares', u'overShares', u'overRatio', u'isFullAmo', u'fundAdd', u'expenseAdd', u'raiseFun', u'raiseNetFun', u'raiseFundFor', u'raiseNetFundFore', u'currency', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','stockType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquAllotmentSubscriptionResultsGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    配股发行的认购情况记录，配股股票类型、配售股东信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 配股说明书公告日(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 配股说明书公告日(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquAllotmentSubscriptionResults.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquAllotmentSubscriptionResultsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquAllotmentSubscriptionResultsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'stockType', u'shortName', u'allotCode', u'proPublishDate', u'resultDate', u'prePlaShareNum', u'actPlaShareNum', u'restShareholderSubscrNum', u'nonrestShareholderSubscrNum', u'underwBalance', u'lshSubscrNum', u'issueRaiseCap', u'subsMode', u'eventID', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shortName': 'str','allotCode': 'str','eventID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSpoPubResultGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司公开增发中签及各类投资者配售结果。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 中签率公告日(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 中签率公告日(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSpoPubResult.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSpoPubResultGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSpoPubResultGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'equTypeCD', u'proPublishDate', u'lotRatPublishDate', u'onlIssCode', u'onlIssShortname', u'floatShareIssue', u'oriHolderNum', u'oriStoNum', u'oriAccNum', u'onlIssShare', u'onlStoNum', u'onlAccNum', u'onlSuccRate', u'onlOversub', u'offlIssueShares', u'offlStoNum', u'offlAccNum', u'offlSuccRate', u'offlOversub', u'balanceStoNum', u'isBack', u'backStoNum', u'stoNum', u'accNum', u'succRate', u'oversub', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','equTypeCD': 'str','onlIssCode': 'str','onlIssShortname': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRelatedTransactionGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    上市公司与关联方交易,包含关联方信息、交易金额、定价方式等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRelatedTransaction.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRelatedTransactionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRelatedTransactionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'transactionsIntroduction', u'connectionRelation', u'relatedPartyName', u'isControl', u'transactionAmount', u'currencyCD', u'pricingBasis', u'tradingMethod', u'payType', u'begainDate', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','transactionsIntroduction': 'str','connectionRelation': 'str','relatedPartyName': 'str','currencyCD': 'str','pricingBasis': 'str','tradingMethod': 'str','payType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRelatedPartyGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司关联方信息，包含关联方性质、地址、注册资本及简介等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquRelatedParty.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRelatedPartyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRelatedPartyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'relatedPartyName', u'connectionRelation', u'type', u'address', u'registeredCapital', u'currencyCode', u'relatedPartyIntro', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','relatedPartyName': 'str','type': 'str','address': 'str','currencyCode': 'str','relatedPartyIntro': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIpoPlanGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录IPO发行时间安排，包括网上发行安排，网下发行安排和发布时间等信息（含科创板）。
    
    :param ticker: 股票代码，如'000001',可以是列表,可空
    :param beginDate: 发布时间(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 发布时间(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIpoPlan.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIpoPlanGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIpoPlanGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'publishDate', u'dateType', u'dateIpo', u'arrange', u'onlineArrage', u'offlineArrage', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','dateType': 'str','arrange': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquBankLoanGet(secID = "", ticker = "", beginDate = "", endDate = "", bank = "", field = "", pandas = "1"):
    """
    记录上市公司向银行贷款情况，包括贷款金额、贷款币种，年限等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 发生日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 发生日期(截止)，输入格式“YYYYMMDD”,可空
    :param bank: 发款银行,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquBankLoan.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(bank, str) and not isinstance(bank, unicode):
        bank = str(bank)

    requestString.append("&bank=%s"%(bank))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquBankLoanGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquBankLoanGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'occurDate', u'bank', u'isVise', u'currency', u'money', u'term', u'begainDate', u'endDate', u'interest', u'type', u'publishDate', u'publishContent', u'guaPerson', u'isRela', u'guarantee', u'guaTerm', u'object', u'notes', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','bank': 'str','currency': 'str','publishContent': 'str','guaPerson': 'str','guarantee': 'str','object': 'str','notes': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquPledgeFreezeGet(secID = "", ticker = "", pubBeginDate = "", pubEndDate = "", beginDate = "", endDate = "", thawBeginDate = "", thawEndDate = "", field = "", pandas = "1"):
    """
    记录上市公司股权冻结起始日期，冻结数量及解押日期的相关信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param pubBeginDate: 发布日期(起始)，输入格式“YYYYMMDD”,可空
    :param pubEndDate: 发布日期(截止)，输入格式“YYYYMMDD”,可空
    :param beginDate: 股份质押冻结起始日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 股份质押冻结起始日期(截止)，输入格式“YYYYMMDD”,可空
    :param thawBeginDate: 解押解冻日期(起始)，输入格式“YYYYMMDD”,可空
    :param thawEndDate: 解押解冻日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquPledgeFreeze.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        pubBeginDate = pubBeginDate.strftime('%Y%m%d')
    except:
        pubBeginDate = pubBeginDate.replace('-', '')
    requestString.append("&pubBeginDate=%s"%(pubBeginDate))
    try:
        pubEndDate = pubEndDate.strftime('%Y%m%d')
    except:
        pubEndDate = pubEndDate.replace('-', '')
    requestString.append("&pubEndDate=%s"%(pubEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        thawBeginDate = thawBeginDate.strftime('%Y%m%d')
    except:
        thawBeginDate = thawBeginDate.replace('-', '')
    requestString.append("&thawBeginDate=%s"%(thawBeginDate))
    try:
        thawEndDate = thawEndDate.strftime('%Y%m%d')
    except:
        thawEndDate = thawEndDate.replace('-', '')
    requestString.append("&thawEndDate=%s"%(thawEndDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquPledgeFreezeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquPledgeFreezeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'typeselect', u'shName', u'orgName', u'involvesum', u'begainDate', u'endDate', u'thawDate', u'statement', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shName': 'str','orgName': 'str','statement': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquOfferGet(secID = "", ticker = "", beginDate = "", endDate = "", resultBeginDate = "", resultEndDate = "", field = "", pandas = "1"):
    """
    记录A股上市公司要约收购的相关信息，包括要约价格、收购数量、中介机构等一系列数据。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 最新公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 最新公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param resultBeginDate: 要约收购结果公告日(起始)，输入格式“YYYYMMDD”,可空
    :param resultEndDate: 要约收购结果公告日(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquOffer.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        resultBeginDate = resultBeginDate.strftime('%Y%m%d')
    except:
        resultBeginDate = resultBeginDate.replace('-', '')
    requestString.append("&resultBeginDate=%s"%(resultBeginDate))
    try:
        resultEndDate = resultEndDate.strftime('%Y%m%d')
    except:
        resultEndDate = resultEndDate.replace('-', '')
    requestString.append("&resultEndDate=%s"%(resultEndDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquOfferGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquOfferGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'offerName', u'offerType', u'issueShortName', u'projRemark', u'isDelist', u'offerPrice', u'offerPriceRemark', u'currencyCD', u'planVolume', u'planVolumePct', u'tradingValue', u'offerCondPret', u'offerDate', u'offerBeginDate', u'offerEndDate', u'offerVolume', u'offerVolumePct', u'payValue', u'transOfferVolume', u'transOfferVolumePct', u'finAdvistory', u'legalConsultant', u'abstPublishDate', u'reportDate', u'resultDate', u'updateTime', u'issueCode', u'offerResult', u'actVolume', u'planPublishDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','offerName': 'str','issueShortName': 'str','projRemark': 'str','offerPriceRemark': 'str','currencyCD': 'str','offerCondPret': 'str','offerDate': 'str','finAdvistory': 'str','legalConsultant': 'str','issueCode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquCompGuaranteeGet(secID = "", ticker = "", beginDate = "", endDate = "", tradeBeginDate = "", tradeEndDate = "", field = "", pandas = "1"):
    """
    记录上市公司在报告期末关于担保的明细，包括被担保对象与上市公司关系，及担保金额。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 报告期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 报告期(截止)，输入格式“YYYYMMDD”,可空
    :param tradeBeginDate: 交易日期(起始)，输入格式“YYYYMMDD”,可空
    :param tradeEndDate: 交易日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquCompGuarantee.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        tradeBeginDate = tradeBeginDate.strftime('%Y%m%d')
    except:
        tradeBeginDate = tradeBeginDate.replace('-', '')
    requestString.append("&tradeBeginDate=%s"%(tradeBeginDate))
    try:
        tradeEndDate = tradeEndDate.strftime('%Y%m%d')
    except:
        tradeEndDate = tradeEndDate.replace('-', '')
    requestString.append("&tradeEndDate=%s"%(tradeEndDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquCompGuaranteeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquCompGuaranteeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'guaCom', u'guaAssocia', u'secParty', u'secPartyAssocia', u'guaWay', u'firstGuaSum', u'currencyUnit', u'guaTerm', u'guaBeginDate', u'guaEndDate', u'isFulfil', u'isRelaTrans', u'tradeDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','guaCom': 'str','secParty': 'str','guaWay': 'str','currencyUnit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquStockPledgeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    A股公司每周累计质押情况，包含质押股份数量、质押笔数、质押比例等信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquStockPledge.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquStockPledgeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquStockPledgeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'nPledgedShares', u'yPledgedShares', u'aTotalShares', u'pledgeNumber', u'pledgeRatio', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquAccumulatedGuaranteeGet(secID = "", ticker = "", pubBeginDate = "", pubEndDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    上市公司报告期对外及对子公司累计担保情况。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param pubBeginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param pubEndDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquAccumulatedGuarantee.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        pubBeginDate = pubBeginDate.strftime('%Y%m%d')
    except:
        pubBeginDate = pubBeginDate.replace('-', '')
    requestString.append("&pubBeginDate=%s"%(pubBeginDate))
    try:
        pubEndDate = pubEndDate.strftime('%Y%m%d')
    except:
        pubEndDate = pubEndDate.replace('-', '')
    requestString.append("&pubEndDate=%s"%(pubEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquAccumulatedGuaranteeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquAccumulatedGuaranteeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'currencyCode', u'guaranteeAmount', u'externalGuaranteeAmount', u'subsidiariesGuaranteeAmount', u'guaranteeOccurs', u'externalGuaranteeOccurs', u'subsidiariesGuaranteeOccurs', u'guaranteeTotalAmount', u'externalGuaranteeBalance', u'subsidiariesGuaranteeBalance', u'guaranteeTotalAmountNar', u'guaranteeAmountRelated', u'guaranteeAmountRatio', u'guaranteeAmountOver', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','currencyCode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquCompProductionGet(ticker = "", secShortName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录各公司主营产品及同类关系
    
    :param ticker: 股票代码，如'000001',可以是列表,ticker、secShortName至少选择一个
    :param secShortName: 股票名称,可以是列表,ticker、secShortName至少选择一个
    :param beginDate: 数据时间(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 数据时间(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquCompProduction.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secShortName=")
    if hasattr(secShortName,'__iter__') and not isinstance(secShortName, str):
        if len(secShortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secShortName
            requestString.append(None)
        else:
            requestString.append(','.join(secShortName))
    else:
        requestString.append(secShortName)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquCompProductionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquCompProductionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'item', u'ticker', u'secShortName', u'prodName', u'prodPct', u'periodDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'item': 'str','ticker': 'str','secShortName': 'str','prodName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquShareholdersMeetingGet(secID = "", ticker = "", pubBeginDate = "", pubEndDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股东大会召开情况，包含会议日期、类型、表决方式、出席情况等信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param pubBeginDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param pubEndDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param beginDate: 会议召开日(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 会议召开日(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShareholdersMeeting.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        pubBeginDate = pubBeginDate.strftime('%Y%m%d')
    except:
        pubBeginDate = pubBeginDate.replace('-', '')
    requestString.append("&pubBeginDate=%s"%(pubBeginDate))
    try:
        pubEndDate = pubEndDate.strftime('%Y%m%d')
    except:
        pubEndDate = pubEndDate.replace('-', '')
    requestString.append("&pubEndDate=%s"%(pubEndDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquShareholdersMeetingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquShareholdersMeetingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'hldMeetDate', u'meetingType', u'meetingMode', u'meetingVotingMethod', u'meetingNumber', u'meetingShares', u'meetingSharesProportion', u'meetingMatters', u'publishDate', u'meetingN', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','meetingMatters': 'str','meetingN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquInstSstateGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司发生特殊状态处理的信息
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 生效日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 生效日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquInstSstate.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquInstSstateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquInstSstateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'partyState', u'effDate', u'reason', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIpoFeeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录首发增发等发行涉及费用的明确信息（含科创板）。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 上市日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 上市日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIpoFee.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIpoFeeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIpoFeeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'issueType', u'feeType', u'feeAmount', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquCscrMemGet(session = "", comType = "", name = "", officeStat = "", birthday = "", field = "", pandas = "1"):
    """
    记录证监会发审委委员及证监会并购重组委员的相关信息，包括委员会届次、人员姓名、出生年月等相关信息（含科创板）。
    
    :param session: 届次。可输入1、2、3……16。,可空
    :param comType: 委员会类型。例如，1-主板发审委，2-创业板发审委，3-并购重组委，5-科创板股票上市委员会。对应DataAPI.SysCodeGet.codeTypeID=20067。,可空
    :param name: 姓名,可空
    :param officeStat: 任职状况。例如，1-专职，2-兼职。对应DataAPI.SysCodeGet.codeTypeID=20068。,可空
    :param birthday: 出生年月，输入格式“XXXX年XX日”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquCscrMem.csv?ispandas=1&') 
    if not isinstance(session, str) and not isinstance(session, unicode):
        session = str(session)

    requestString.append("session=%s"%(session))
    if not isinstance(comType, str) and not isinstance(comType, unicode):
        comType = str(comType)

    requestString.append("&comType=%s"%(comType))
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    if not isinstance(officeStat, str) and not isinstance(officeStat, unicode):
        officeStat = str(officeStat)

    requestString.append("&officeStat=%s"%(officeStat))
    if not isinstance(birthday, str) and not isinstance(birthday, unicode):
        birthday = str(birthday)

    requestString.append("&birthday=%s"%(birthday))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquCscrMemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquCscrMemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'session', u'comType', u'name', u'officeStat', u'gender', u'birthday', u'unit', u'position', u'title', u'eduBackg', u'major', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','birthday': 'str','unit': 'str','position': 'str','title': 'str','major': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MdSwBackGet(secID = "", ticker = "", intoDate = "", outDate = "", field = "", pandas = "1"):
    """
    申万行业回填（含科创板）。
    
    :param secID: 证券代码,格式是“数字.交易所代码”，如000001.XSHE。,可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param intoDate: 输入日期，可以获取这一天股票的行业信息,可空
    :param outDate: 输入日期，可以获取这一天股票的行业信息,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getMdSwBack.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        intoDate = intoDate.strftime('%Y%m%d')
    except:
        intoDate = intoDate.replace('-', '')
    requestString.append("&intoDate=%s"%(intoDate))
    try:
        outDate = outDate.strftime('%Y%m%d')
    except:
        outDate = outDate.replace('-', '')
    requestString.append("&outDate=%s"%(outDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MdSwBackGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MdSwBackGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'secFullName', u'partyID', u'oldTypeName', u'intoDate', u'outDate', u'isNew', u'industryID1', u'industryName1', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','secFullName': 'str','oldTypeName': 'str','industryID1': 'str','industryName1': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquShareholderNumGet(secID = "", ticker = "", beginDate = "", endDate = "", beginPublishDate = "", endPublishDate = "", field = "", pandas = "1"):
    """
    获取上市公司股东户数，包含公司截止某个时期的股东总户数及户均持股数量信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期(起始)，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期(截止)，输入格式“YYYYMMDD”,可空
    :param beginPublishDate: 公告日期(起始)，输入格式“YYYYMMDD”,可空
    :param endPublishDate: 公告日期(截止)，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShareholderNum.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginPublishDate = beginPublishDate.strftime('%Y%m%d')
    except:
        beginPublishDate = beginPublishDate.replace('-', '')
    requestString.append("&beginPublishDate=%s"%(beginPublishDate))
    try:
        endPublishDate = endPublishDate.strftime('%Y%m%d')
    except:
        endPublishDate = endPublishDate.replace('-', '')
    requestString.append("&endPublishDate=%s"%(endPublishDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquShareholderNumGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquShareholderNumGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'endDate', u'securityNum', u'isSecurityNum', u'shNum', u'avgHoldNum', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def VfsttargetGet(secID = "", ticker = "", beginIntoDate = "", endIntoDate = "", isTarget = "", targetType = "", field = "", pandas = "1"):
    """
    记录融资融券标的证券的信息，包括代码、是否为标的证券、标的类型、纳入及剔除日期等具体信息。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker至少选择一个
    :param ticker: 股票代码，如'000001',可以是列表,secID、ticker至少选择一个
    :param beginIntoDate: 纳入日期(起始)，输入格式“YYYYMMDD”,可空
    :param endIntoDate: 纳入日期(截止)，输入格式“YYYYMMDD”,可空
    :param isTarget: 是否为标的证券,例如:1-是,0-否,9-未获知.,可空
    :param targetType: 标的类别,例如:10-融资买入标的,20-融资卖出标的.,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getVfsttarget.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginIntoDate = beginIntoDate.strftime('%Y%m%d')
    except:
        beginIntoDate = beginIntoDate.replace('-', '')
    requestString.append("&beginIntoDate=%s"%(beginIntoDate))
    try:
        endIntoDate = endIntoDate.strftime('%Y%m%d')
    except:
        endIntoDate = endIntoDate.replace('-', '')
    requestString.append("&endIntoDate=%s"%(endIntoDate))
    if not isinstance(isTarget, str) and not isinstance(isTarget, unicode):
        isTarget = str(isTarget)

    requestString.append("&isTarget=%s"%(isTarget))
    if not isinstance(targetType, str) and not isinstance(targetType, unicode):
        targetType = str(targetType)

    requestString.append("&targetType=%s"%(targetType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'VfsttargetGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'VfsttargetGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'targetType', u'intoDate', u'outDate', u'isTarget', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIPOlottoGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    记录新股中签号码，包含股票代码、中签号码末尾位数及对应的中签号码信息（含科创板）。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIPOlotto.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIPOlottoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIPOlottoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'digitLastNums', u'lottNo', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','lottNo': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquLawSuitsGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", lawsuitType = "", field = "", pandas = "1"):
    """
    上市公司诉讼仲裁等重大事项描述及说明，包括诉讼案件、诉讼被告及原告，案件进展等信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID至少选择一个
    :param beginDate: 公告日起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日截止日期，输入格式“YYYYMMDD”,可空
    :param lawsuitType: 诉讼类型,如民事诉讼、行政诉讼等,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquLawSuits.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&lawsuitType=")
    if hasattr(lawsuitType,'__iter__') and not isinstance(lawsuitType, str):
        if len(lawsuitType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = lawsuitType
            requestString.append(None)
        else:
            requestString.append(','.join(lawsuitType))
    else:
        requestString.append(lawsuitType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquLawSuitsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquLawSuitsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'lawsuitType', u'sueDate', u'abstract', u'caseIntroduction', u'eventPrce', u'suitAmount', u'currencyCode', u'accuser', u'accused', u'firstInstanceInst', u'firstJudgmentDate', u'isAppeal', u'appealSide', u'secondInstanceInst', u'secondJudgmentDate', u'caseContent', u'remark', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','abstract': 'str','caseIntroduction': 'str','eventPrce': 'str','currencyCode': 'str','accuser': 'str','accused': 'str','firstInstanceInst': 'str','secondInstanceInst': 'str','caseContent': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquOldShofferGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录股票首次公开发行上市中，老股东对原持有股份转让情况，包括股东名称、原持股数量、原持股比例、拟发售股数及实际发售股数等信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 公告日起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 公告日截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquOldShoffer.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquOldShofferGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquOldShofferGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'shName', u'orgShareNum', u'preShareRatio', u'supOfferShares', u'actOfferShares', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquCsrcListGet(beginDate = "", endDate = "", indexCode = "", pubLevel = "", field = "", pandas = "1"):
    """
    证监会各体裁文种批文，包括公告名称，类别，正文等内容（含科创板）。
    
    :param beginDate: 起始发文日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 截止发文日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param indexCode: 索引号,可以是列表,可空
    :param pubLevel: 公告级别，分为1级、2级、3级,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquCsrcList.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&indexCode=")
    if hasattr(indexCode,'__iter__') and not isinstance(indexCode, str):
        if len(indexCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indexCode
            requestString.append(None)
        else:
            requestString.append(','.join(indexCode))
    else:
        requestString.append(indexCode)
    requestString.append("&pubLevel=")
    if hasattr(pubLevel,'__iter__') and not isinstance(pubLevel, str):
        if len(pubLevel) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = pubLevel
            requestString.append(None)
        else:
            requestString.append(','.join(pubLevel))
    else:
        requestString.append(pubLevel)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquCsrcListGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquCsrcListGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indexCode', u'pubInst', u'pubType', u'pubLevel', u'pubName', u'publishDate', u'pubCode', u'mainBody', u'extraErl', u'url', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indexCode': 'str','pubInst': 'str','pubType': 'str','pubLevel': 'str','pubName': 'str','pubCode': 'str','mainBody': 'str','extraErl': 'str','url': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquIPOFlfileInfoGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    记录IPO网下投资者材料递交信息，包含股票代码、联系邮箱、联系电话等信息（含科创板）。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquIPOFlfileInfo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquIPOFlfileInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquIPOFlfileInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'email', u'tel', u'postAddr', u'postCode', u'remark', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','email': 'str','tel': 'str','postAddr': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSpecCondGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股权激励方案激励授予的特别条件。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 最新公告日起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 最新公告日截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSpecCond.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSpecCondGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSpecCondGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'excitSubject', u'excitCons', u'exerPer', u'rank', u'achAsseSub', u'achAsseBenY', u'achAsseBen', u'indicType', u'statType', u'achAsseY', u'unitCD', u'achAsseUpl', u'achAsseLl', u'remark', u'eventID', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','excitSubject': 'str','excitCons': 'str','exerPer': 'str','rank': 'str','achAsseSub': 'str','achAsseBenY': 'str','achAsseBen': 'str','indicType': 'str','statType': 'str','achAsseY': 'str','unitCD': 'str','remark': 'str','eventID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquOperDataGet(beginDate, secID = "", ticker = "", partyID = "", typeID = "", endDate = "", statTypeCD = "", field = "", pandas = "1"):
    """
    记录上市公司公司披露的有利于投资者决策的行业经营性信息。
    
    :param beginDate: 报告截止，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID、typeID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID、typeID至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID、typeID至少选择一个
    :param typeID: 行业ID，可在getIndustry接口获取,可以是列表,secID、ticker、partyID、typeID至少选择一个
    :param endDate: 截止日期（报告期），输入格式“YYYYMMDD”,可空
    :param statTypeCD: 指标统计类型代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquOperData.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&statTypeCD=")
    if hasattr(statTypeCD,'__iter__') and not isinstance(statTypeCD, str):
        if len(statTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(statTypeCD))
    else:
        requestString.append(statTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquOperDataGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquOperDataGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'typeID', u'typeName', u'publishDate', u'frequencyCD', u'endDate', u'fiscalPeriod', u'title', u'itemTypeCD', u'itemType', u'itemNo', u'itemParentNo', u'itemID', u'indicTypeCD', u'indicType', u'statTypeCD', u'statType', u'value', u'unit', u'content', u'valueMax', u'valueMin', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','typeID': 'str','typeName': 'str','frequencyCD': 'str','title': 'str','itemTypeCD': 'str','itemType': 'str','itemNo': 'str','itemParentNo': 'str','indicTypeCD': 'str','indicType': 'str','statTypeCD': 'str','statType': 'str','unit': 'str','content': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSharesChgGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股份变动情况，相比旧版内容更细分，数据更稳定（含科创板）。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID至少选择一个
    :param beginDate: 公告日起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquSharesChg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSharesChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSharesChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'changeDate', u'changeType', u'totalShares', u'floatShares', u'floatA', u'floatB', u'floatH', u'floatOverseas', u'restShares', u'restA', u'restState', u'restStateLegal', u'restOtherDome', u'restLegalPer', u'restPer', u'restManager', u'restFr', u'restFrLegalPer', u'restFrPer', u'restB', u'restH', u'nonfShares', u'nonfStateShares', u'nonfStateLegal', u'nonfDomeCap', u'nonfFr', u'nonfFrLegalPer', u'nonfOtherFr', u'nonfOthSpoShares', u'nonfCorpRa', u'nonfStateLegalRa', u'nonfPerson', u'nonfEmployee', u'nonfTransfer', u'nonfPreOther', u'nonfPre', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','changeType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquPledgeGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股权质押起始日期，质押数量及解押日期的相关信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID至少选择一个
    :param beginDate: 公告日起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquPledge.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquPledgeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquPledgeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'shName', u'shNameType', u'orgName', u'involvesum', u'pledgeShare', u'shareType', u'isCollateralRepo', u'holdVol', u'holdPct', u'accPledge', u'accPledgeShare', u'accPledgeTotal', u'beginDate', u'endDate', u'thawDate', u'isThaw', u'statement', u'eventNum', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','shName': 'str','shNameType': 'str','orgName': 'str','statement': 'str','eventNum': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquShNredGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股东承诺所持股份不减持的相关信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID至少选择一个
    :param beginDate: 公告日起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquShNred.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquShNredGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquShNredGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'publishDate', u'objectName', u'objectType', u'isActContSub', u'isComtFulfilled', u'isComt', u'shareNum', u'excitSharesPct', u'comtTime', u'beginDate', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','objectName': 'str','objectType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMExposureDayGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表反映了个股对各风格因子和行业因子的暴露值。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMExposureDay.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMExposureDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMExposureDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'secID', u'exchangeCD', u'secShortName', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','ticker': 'str','secID': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMFactorRetDayGet(beginDate = "", endDate = "", tradeDate = "", field = "", pandas = "1"):
    """
    该表计算了风格因子和行业因子的收益。
    
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,beginDate、endDate、tradeDate至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,beginDate、endDate、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,beginDate、endDate、tradeDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMFactorRetDay.csv?ispandas=1&') 
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMFactorRetDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMFactorRetDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMSpecificRetDayGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了个股的特质收益。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMSpecificRetDay.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMSpecificRetDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMSpecificRetDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'secID', u'exchangeCD', u'secShortName', u'spret', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','ticker': 'str','secID': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMCovarianceDayGet(tradeDate = "", beginDate = "", endDate = "", Factor = "", field = "", pandas = "1"):
    """
    该表计算了day级别的风险因子协方差矩阵。
    
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param Factor: 因子名称,可以是列表,tradeDate、beginDate、endDate、Factor至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMCovarianceDay.csv?ispandas=1&') 
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&Factor=")
    if hasattr(Factor,'__iter__') and not isinstance(Factor, str):
        if len(Factor) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = Factor
            requestString.append(None)
        else:
            requestString.append(','.join(Factor))
    else:
        requestString.append(Factor)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMCovarianceDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMCovarianceDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'FactorID', u'Factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','Factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMCovarianceShortGet(Factor = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了short级别的风险因子协方差矩阵。
    
    :param Factor: 因子名称,可以是列表,Factor、tradeDate、beginDate、endDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,Factor、tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,Factor、tradeDate、beginDate、endDate至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,Factor、tradeDate、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMCovarianceShort.csv?ispandas=1&') 
    requestString.append("Factor=")
    if hasattr(Factor,'__iter__') and not isinstance(Factor, str):
        if len(Factor) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = Factor
            requestString.append(None)
        else:
            requestString.append(','.join(Factor))
    else:
        requestString.append(Factor)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMCovarianceShortGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMCovarianceShortGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'FactorID', u'Factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','Factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMCovarianceLongGet(Factor = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了long级别的风险因子协方差矩阵。
    
    :param Factor: 因子名称,可以是列表,Factor、tradeDate、beginDate、endDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,Factor、tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,Factor、tradeDate、beginDate、endDate至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,Factor、tradeDate、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMCovarianceLong.csv?ispandas=1&') 
    requestString.append("Factor=")
    if hasattr(Factor,'__iter__') and not isinstance(Factor, str):
        if len(Factor) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = Factor
            requestString.append(None)
        else:
            requestString.append(','.join(Factor))
    else:
        requestString.append(Factor)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMCovarianceLongGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMCovarianceLongGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'FactorID', u'Factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','Factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMSriskDayGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了day级别个股的特质风险。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMSriskDay.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMSriskDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMSriskDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'secID', u'exchangeCD', u'secShortName', u'SRISK', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','ticker': 'str','secID': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMSriskShortGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了short级别个股的特质风险。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMSriskShort.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMSriskShortGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMSriskShortGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'secID', u'exchangeCD', u'secShortName', u'SRISK', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','ticker': 'str','secID': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMSriskLongGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了long级别个股的特质风险。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMSriskLong.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMSriskLongGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMSriskLongGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'secID', u'exchangeCD', u'secShortName', u'SRISK', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','ticker': 'str','secID': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquMarginSecGet(beginDate, endDate, secID = "", ticker = "", pubInstCode = "", field = "", pandas = "1"):
    """
    东方证券、国泰君安、国信证券、华泰证券、上交所、申万宏源、深交所、银河证券、中信证券所公布的每个交易日的可充抵保证金标的证券信息。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”
    :param endDate: 截止日期，输入格式“YYYYMMDD”
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、pubInstCode至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、pubInstCode至少选择一个
    :param pubInstCode: 发布机构代码,可以是列表,secID、ticker、pubInstCode至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getEquMarginSec.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&pubInstCode=")
    if hasattr(pubInstCode,'__iter__') and not isinstance(pubInstCode, str):
        if len(pubInstCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = pubInstCode
            requestString.append(None)
        else:
            requestString.append(','.join(pubInstCode))
    else:
        requestString.append(pubInstCode)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquMarginSecGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquMarginSecGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'pubInstCode', u'pubInst', u'pubInstPartyID', u'convertRate', u'publishDate', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','pubInst': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMSriskDayV2Get(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了day级别个股的特质风险。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMSriskDayV2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMSriskDayV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMSriskDayV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'SRISK', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMSriskShortV2Get(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了short级别个股的特质风险。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMSriskShortV2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMSriskShortV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMSriskShortV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'SRISK', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMSriskLongV2Get(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了long级别个股的特质风险。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMSriskLongV2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMSriskLongV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMSriskLongV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'SRISK', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMCovarianceDayV2Get(tradeDate = "", beginDate = "", endDate = "", Factor = "", field = "", pandas = "1"):
    """
    该表计算了day级别风险因子协方差矩阵。
    
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param Factor: 因子名称,可以是列表,tradeDate、beginDate、endDate、Factor至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMCovarianceDayV2.csv?ispandas=1&') 
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&Factor=")
    if hasattr(Factor,'__iter__') and not isinstance(Factor, str):
        if len(Factor) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = Factor
            requestString.append(None)
        else:
            requestString.append(','.join(Factor))
    else:
        requestString.append(Factor)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMCovarianceDayV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMCovarianceDayV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'FactorID', u'Factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','Factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMCovarianceShortV2Get(tradeDate = "", beginDate = "", endDate = "", Factor = "", field = "", pandas = "1"):
    """
    该表计算了short级别风险因子协方差矩阵。
    
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param Factor: 因子名称,可以是列表,tradeDate、beginDate、endDate、Factor至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMCovarianceShortV2.csv?ispandas=1&') 
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&Factor=")
    if hasattr(Factor,'__iter__') and not isinstance(Factor, str):
        if len(Factor) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = Factor
            requestString.append(None)
        else:
            requestString.append(','.join(Factor))
    else:
        requestString.append(Factor)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMCovarianceShortV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMCovarianceShortV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'FactorID', u'Factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','Factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RMCovarianceLongV2Get(tradeDate = "", beginDate = "", endDate = "", Factor = "", field = "", pandas = "1"):
    """
    该表计算了long级别风险因子协方差矩阵。
    
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate、Factor至少选择一个
    :param Factor: 因子名称,可以是列表,tradeDate、beginDate、endDate、Factor至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getRMCovarianceLongV2.csv?ispandas=1&') 
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&Factor=")
    if hasattr(Factor,'__iter__') and not isinstance(Factor, str):
        if len(Factor) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = Factor
            requestString.append(None)
        else:
            requestString.append(','.join(Factor))
    else:
        requestString.append(Factor)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RMCovarianceLongV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RMCovarianceLongV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'FactorID', u'Factor', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','Factor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def Dy1dExposureV2Get(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表反映了个股对各风格因子和行业因子的暴露值，即股票在各风格因子和行业因子上的取值。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getDy1dExposureV2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'Dy1dExposureV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'Dy1dExposureV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'secID', u'exchangeCD', u'secShortName', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','ticker': 'str','secID': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def Dy1dFactorRetV2Get(beginDate = "", endDate = "", tradeDate = "", field = "", pandas = "1"):
    """
    该表计算了风格因子和行业因子对应的收益率。各因子计算查看dy1d_exposure表，该表数据代表着因子收益率，即exposure为自变量，个股收益为因变量，回归得到的各因子系数。
    
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,beginDate、endDate、tradeDate至少选择一个
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,beginDate、endDate、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,beginDate、endDate、tradeDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getDy1dFactorRetV2.csv?ispandas=1&') 
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'Dy1dFactorRetV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'Dy1dFactorRetV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'BETA', u'MOMENTUM', u'SIZE', u'EARNYILD', u'RESVOL', u'GROWTH', u'BTOP', u'LEVERAGE', u'LIQUIDTY', u'SIZENL', u'Bank', u'RealEstate', u'Health', u'Transportation', u'Mining', u'NonFerMetal', u'HouseApp', u'LeiService', u'MachiEquip', u'BuildDeco', u'CommeTrade', u'CONMAT', u'Auto', u'Textile', u'FoodBever', u'Electronics', u'Computer', u'LightIndus', u'Utilities', u'Telecom', u'AgriForest', u'CHEM', u'Media', u'IronSteel', u'NonBankFinan', u'ELECEQP', u'AERODEF', u'Conglomerates', u'COUNTRY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def Dy1dSpecificRetV2Get(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    该表计算了个股的特质收益。
    
    :param secID: 证券内部编码，一串流水号,可先通过DataAPI.SecIDGet获取到，如在DataAPI.SecIDGet，选择证券类型为'E',输入'000001'，可获取到ID'000001.XSHE'后，在此输入'000001.XSHE',可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 交易日的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/equity/getDy1dSpecificRetV2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'Dy1dSpecificRetV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'Dy1dSpecificRetV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'secID', u'exchangeCD', u'secShortName', u'spret', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeDate': 'str','ticker': 'str','secID': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKcapStructureGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录港股股本结构数据，包括变动类型、变动日期、总股本、普通股、优先股等信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE，部分使用“临时代码.证券市场”格式。可使用DataAPI.SecIDGet接口传入证券交易代码获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID至少选择一个
    :param beginDate: 公告日期查询的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 公告日期查询的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKcapStructure.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKcapStructureGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKcapStructureGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'publishDate', u'changeDate', u'chgReason', u'commonShares', u'preShares', u'otherShares', u'totalShares', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','chgReason': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKshszFlowGet(beginDate = "", endDate = "", statsFreq = "", tradeDrec = "", fundDrec = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    统计沪深港通前十大活跃个股资金流向。
    
    :param beginDate: 交易日起始日期，输入格式“YYYYMMDD”,beginDate、endDate、statsFreq、tradeDrec、fundDrec至少选择一个
    :param endDate: 交易日截止日期，输入格式“YYYYMMDD”,beginDate、endDate、statsFreq、tradeDrec、fundDrec至少选择一个
    :param statsFreq: 统计周期，D-近一日，W-近七日,可以是列表,beginDate、endDate、statsFreq、tradeDrec、fundDrec至少选择一个
    :param tradeDrec: 买卖方向，分为“净买入”和“净卖出”,可以是列表,beginDate、endDate、statsFreq、tradeDrec、fundDrec至少选择一个
    :param fundDrec: 资金方向，分为“北向”与“南向”,可以是列表,beginDate、endDate、statsFreq、tradeDrec、fundDrec至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,可空
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKshszFlow.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&statsFreq=")
    if hasattr(statsFreq,'__iter__') and not isinstance(statsFreq, str):
        if len(statsFreq) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsFreq
            requestString.append(None)
        else:
            requestString.append(','.join(statsFreq))
    else:
        requestString.append(statsFreq)
    requestString.append("&tradeDrec=")
    if hasattr(tradeDrec,'__iter__') and not isinstance(tradeDrec, str):
        if len(tradeDrec) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDrec
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDrec))
    else:
        requestString.append(tradeDrec)
    requestString.append("&fundDrec=")
    if hasattr(fundDrec,'__iter__') and not isinstance(fundDrec, str):
        if len(fundDrec) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fundDrec
            requestString.append(None)
        else:
            requestString.append(','.join(fundDrec))
    else:
        requestString.append(fundDrec)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKshszFlowGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKshszFlowGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'statsFreq', u'tradeDrec', u'fundDrec', u'rank', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'netAmount', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'statsFreq': 'str','tradeDrec': 'str','fundDrec': 'str','secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKCompanyNameChgGet(partyID = "", secID = "", secShortName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录港股公司中英文全称更名名称变化情况，包括变动日期、更名前中文全称、更名后中文全称、更名前英文全称、更名后英文全称等信息。
    
    :param partyID: 公司ID,可以是列表,partyID、secID、secShortName至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE，部分使用“临时代码.证券市场”格式。可使用DataAPI.SecIDGet接口传入证券交易代码获取到。,可以是列表,partyID、secID、secShortName至少选择一个
    :param secShortName: 证券中文简称,支持模糊查询,partyID、secID、secShortName至少选择一个
    :param beginDate: 变更日期查询起始时间,格式为YYYYMMDD,可空
    :param endDate: 变更日期查询截止时间,格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKCompanyNameChg.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKCompanyNameChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKCompanyNameChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'chgDate', u'exchangeCD', u'secShortName', u'secShortNameEN', u'renameAfCN', u'renameAfEN', u'renameBFCN', u'renameBFEN']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyID': 'str','secID': 'str','exchangeCD': 'str','secShortName': 'str','secShortNameEN': 'str','renameAfCN': 'str','renameAfEN': 'str','renameBFCN': 'str','renameBFEN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKEquGet(secID = "", ticker = "", listStatusCD = "", field = "", pandas = "1"):
    """
    获取香港交易所上市股票的基本信息，包含股票交易代码及其简称、股票类型、上市状态、上市板块、上市日期等；上市状态为最新状态。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE，部分使用“临时代码.证券市场”格式。可使用DataAPI.SecIDGet接口传入证券交易代码获取到。,可以是列表,secID、ticker、listStatusCD至少选择一个
    :param ticker: 证券交易代码，如'00001',可以是列表,secID、ticker、listStatusCD至少选择一个
    :param listStatusCD: 上市状态，可选状态有:L-上市，S-暂停，DE-终止上市，UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,secID、ticker、listStatusCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKEqu.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKEquGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKEquGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'listStatusCD', u'ListSectorCD', u'ListSector', u'equTypeCD', u'equType', u'transCurrCD', u'tradingUnit', u'secFullName', u'secShortName', u'exCountryCD', u'listDate', u'delistDate', u'partyID', u'exchangeCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','listStatusCD': 'str','ListSector': 'str','equTypeCD': 'str','equType': 'str','transCurrCD': 'str','tradingUnit': 'str','secFullName': 'str','secShortName': 'str','exCountryCD': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKEquCAGet(secID = "", ticker = "", eventTypeCD = "", field = "", pandas = "1"):
    """
    获取香港交易所上市公司行为，包含有首发、现金增资、分红、拆细等。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE，部分使用“临时代码.证券市场”格式。可使用DataAPI.SecIDGet接口传入证券交易代码获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券交易代码，如'00001',可以是列表,secID、ticker至少选择一个
    :param eventTypeCD: 公司行为类别，可选行为类别:1 首发，2 现金增资(不含供股)，3 现金增资(供股)，4 拆股，5 并股，6 回购，7 现金分红，8 股票分红；默认为7 现金分红。对应DataAPI.SysCodeGet.codeTypeID=50001。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKEquCA.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&eventTypeCD=")
    if hasattr(eventTypeCD,'__iter__') and not isinstance(eventTypeCD, str):
        if len(eventTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(eventTypeCD))
    else:
        requestString.append(eventTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKEquCAGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKEquCAGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'eventNum', u'eventTypeCD', u'eventType', u'statusCD', u'status', u'newShares', u'oldShares', u'currencyCD', u'cash', u'corShares', u'exePrice', u'publishDate', u'recordDate', u'exDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','eventTypeCD': 'str','eventType': 'str','statusCD': 'str','status': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def equSHHKQuotaGet(exchangeCD = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取交易所发布的沪港通每日额度信息，包含每日额度以及每日额度余额等。沪港通总额度的限制于2016年08月16日取消，总额度、总额度余额自20160817起停止更新。
    
    :param exchangeCD: 沪深港通交易方向代码,可以是列表,可空
    :param tradeDate: 交易日期,可以是列表,可空
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getequSHHKQuota.csv?ispandas=1&') 
    requestString.append("exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'equSHHKQuotaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'equSHHKQuotaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'tradeDate', u'totalQuota', u'totalQuotaBal', u'dailyQuota', u'dailyQuotaBal', u'dailyQuotaPercent', u'currCD', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','currCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def equSHHKstatsTDGet(tradeDate = "", exchangeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪港通每日成交统计，包括沪股通和港股通的买入成交笔数、买入成交额，卖出成交笔数、卖出成交额、总成交笔数、总成交金额等。
    
    :param tradeDate: 交易日期,可以是列表,可空
    :param exchangeCD: 沪深港通交易方向代码,可以是列表,可空
    :param beginDate: 交易起始日期，格式为“YYYYMMDD”,可空
    :param endDate: 交易截止日期，格式为“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getequSHHKstatsTD.csv?ispandas=1&') 
    requestString.append("tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'equSHHKstatsTDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'equSHHKstatsTDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'tradeDate', u'buyVolume', u'sellVolume', u'buyValue', u'sellValue', u'totalVolume', u'totalValue', u'currCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','currCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def equSHHKTDTenGet(exchangeCD = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪港通每日总成交额排名前十的个股成交统计，包括沪股通和港股通的买入成交额、卖出成交额、总成交额等。
    
    :param exchangeCD: 沪深港通交易方向代码,可以是列表,可空
    :param tradeDate: 交易日期,可以是列表,可空
    :param beginDate: 交易起始日期，格式为“YYYYMMDD”,可空
    :param endDate: 交易截止日期，格式为“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getequSHHKTDTen.csv?ispandas=1&') 
    requestString.append("exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'equSHHKTDTenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'equSHHKTDTenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'tradeDate', u'secID', u'tickerSymbol', u'secShortName', u'secexchangeCD', u'buyValue', u'sellValue', u'totalValue', u'currCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','secID': 'str','tickerSymbol': 'str','secShortName': 'str','secexchangeCD': 'str','currCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def equSZHKConsGet(exchangeCD = "", intoDate = "", isNew = "", field = "", pandas = "1"):
    """
    查询获取深港通合资格股票名单，及历史调入、调出信息。
    
    :param exchangeCD: 沪深港通交易方向代码,exchangeCD、intoDate、isNew至少选择一个
    :param intoDate: 输入日期，可以获取这一天沪港通合资格股票名单，输入格式“YYYYMMDD”,exchangeCD、intoDate、isNew至少选择一个
    :param isNew: 是否最新：1-是，0-否,exchangeCD、intoDate、isNew至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getequSZHKCons.csv?ispandas=1&') 
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("exchangeCD=%s"%(exchangeCD))
    try:
        intoDate = intoDate.strftime('%Y%m%d')
    except:
        intoDate = intoDate.replace('-', '')
    requestString.append("&intoDate=%s"%(intoDate))
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'equSZHKConsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'equSZHKConsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'secID', u'ticker', u'secShortName', u'secFullName', u'intoDate', u'outDate', u'isNew']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','secID': 'str','ticker': 'str','secShortName': 'str','secFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def equSZHKQuotaGet(exchangeCD = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取交易所发布的深港通每日额度信息，包含每日额度、每日额度余额、成交净额占比等。
    
    :param exchangeCD: 沪深港通交易方向代码,可以是列表,可空
    :param tradeDate: 交易日期,可以是列表,可空
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getequSZHKQuota.csv?ispandas=1&') 
    requestString.append("exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'equSZHKQuotaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'equSZHKQuotaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'tradeDate', u'totalQuota', u'totalQuotaBal', u'dailyQuota', u'dailyQuotaBal', u'dailyQuotaPercent', u'currCD', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','currCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def equSZHKstatsTDGet(exchangeCD = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取深港通每日成交统计，包括深股通和港股通的买入成交笔数、买入成交额，卖出成交笔数、卖出成交额、总成交笔数、总成交金额等。
    
    :param exchangeCD: 沪深港通交易方向代码,可以是列表,可空
    :param tradeDate: 交易日期,可以是列表,可空
    :param beginDate: 交易起始日期，格式为“YYYYMMDD”,可空
    :param endDate: 交易截止日期，格式为“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getequSZHKstatsTD.csv?ispandas=1&') 
    requestString.append("exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'equSZHKstatsTDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'equSZHKstatsTDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'tradeDate', u'buyVolume', u'sellVolume', u'buyValue', u'sellValue', u'totalVolume', u'totalValue', u'currCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','currCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def equSZHKTDTenGet(exchangeCD = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取深港通每日总成交额排名前十的个股成交统计，包括深股通和港股通的买入成交额、卖出成交额、总成交额等。
    
    :param exchangeCD: 沪深港通交易方向代码,可以是列表,可空
    :param tradeDate: 交易日期,可以是列表,可空
    :param beginDate: 查询起始日期，格式为“YYYYMMDD”,可空
    :param endDate: 查询截止日期，格式为“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getequSZHKTDTen.csv?ispandas=1&') 
    requestString.append("exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'equSZHKTDTenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'equSZHKTDTenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'tradeDate', u'secID', u'tickerSymbol', u'secShortName', u'secexchangeCD', u'buyValue', u'sellValue', u'totalValue', u'currCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','secID': 'str','tickerSymbol': 'str','secShortName': 'str','secexchangeCD': 'str','currCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def equSZHKForexGet(tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取深交所发布的深港通的参考汇率及结算汇率，包含参考汇率买入价、参考汇率卖出价、买入结算汇兑比率、卖出结算汇兑比率等。参考汇率为当日交易参考的汇率，盘前公布；结算汇率为当日盘后清算时的实际转换汇率，盘后公布。
    
    :param tradeDate: 交易日期,可以是列表,tradeDate、beginDate、endDate至少选择一个
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”。,tradeDate、beginDate、endDate至少选择一个
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,tradeDate、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getequSZHKForex.csv?ispandas=1&') 
    requestString.append("tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'equSZHKForexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'equSZHKForexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'currencyPair', u'refBid', u'refAsk', u'stlBid', u'stlAsk']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquSHHKforexGet(beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取上交所发布的沪港通的参考汇率及结算汇率，包含参考汇率买入价、参考汇率卖出价、买入结算汇兑比率、卖出结算汇兑比率等。参考汇率为当日交易参考的汇率，盘前公布；结算汇率为当日盘后清算时的实际转换汇率，盘后公布。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getEquSHHKforex.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquSHHKforexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquSHHKforexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'forexQtType', u'currencyPair', u'refBid', u'refAsk', u'stlBid', u'stlAsk', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKmktProGet(beginDate = "", endDate = "", frequencyCD = "", typeID = "", field = "", pandas = "1"):
    """
    获取港股月度及年度市场概况，包括主板、创业板、主板及创业板合计的年度及月度上市公司统计、成交统计、市值统计、市盈率统计、周息率统计等指标。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,beginDate、endDate、frequencyCD、typeID至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,beginDate、endDate、frequencyCD、typeID至少选择一个
    :param frequencyCD: 统计频率，M-月度；A年度,可以是列表,beginDate、endDate、frequencyCD、typeID至少选择一个
    :param typeID: 港股板块分类代码，0201020101-主板；0201020102-创业板；020102-港股,可以是列表,beginDate、endDate、frequencyCD、typeID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKmktPro.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&frequencyCD=")
    if hasattr(frequencyCD,'__iter__') and not isinstance(frequencyCD, str):
        if len(frequencyCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = frequencyCD
            requestString.append(None)
        else:
            requestString.append(','.join(frequencyCD))
    else:
        requestString.append(frequencyCD)
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKmktProGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKmktProGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'frequencyCD', u'typeID', u'listComNum', u'listSecNum', u'addComNum', u'totalTurnoverValue', u'avgTurnoverValue', u'totalVol', u'avgVol', u'totalDealAmount', u'avgDealAmount', u'totalMktValue', u'avgPe', u'avgDivYield', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'frequencyCD': 'str','typeID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKindustryStatsGet(beginDate = "", endDate = "", frequencyCD = "", industryCD = "", field = "", pandas = "1"):
    """
    获取港股以行业统计的月度市场概况，包含成分数量、总市值、成交金额、平均市盈率、平均周息率等。统计所用行业为恒生一级行业。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,beginDate、endDate、frequencyCD、industryCD至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,beginDate、endDate、frequencyCD、industryCD至少选择一个
    :param frequencyCD: 统计周期代码，目前只有：M-月,可以是列表,beginDate、endDate、frequencyCD、industryCD至少选择一个
    :param industryCD: 通联编制的行业分类编码，可使用DataAPI.SysCodeGet.codeTypeID=90046获取数字编码,可以是列表,beginDate、endDate、frequencyCD、industryCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKindustryStats.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&frequencyCD=")
    if hasattr(frequencyCD,'__iter__') and not isinstance(frequencyCD, str):
        if len(frequencyCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = frequencyCD
            requestString.append(None)
        else:
            requestString.append(','.join(frequencyCD))
    else:
        requestString.append(frequencyCD)
    requestString.append("&industryCD=")
    if hasattr(industryCD,'__iter__') and not isinstance(industryCD, str):
        if len(industryCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryCD
            requestString.append(None)
        else:
            requestString.append(','.join(industryCD))
    else:
        requestString.append(industryCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKindustryStatsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKindustryStatsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'frequencyCD', u'industryCD', u'listComNum', u'mktValue', u'marketValuePct', u'turnoverValue', u'turnoverValuePct', u'avgPe', u'avgDivYield', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'frequencyCD': 'str','industryCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKhrcProGet(beginDate = "", endDate = "", frequencyCD = "", boardTypeID = "", shareTypeID = "", field = "", pandas = "1"):
    """
    获取港交所月度公布的中资股月度市场概况，包含成交金额、总市值、募资额等。其中市值为当期值，成交额及募资额为当年累计值。板块分为：主板/创业板/合计；股票类型分为：H股/红筹股/合计。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,beginDate、endDate、frequencyCD、boardTypeID、shareTypeID至少选择一个
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,beginDate、endDate、frequencyCD、boardTypeID、shareTypeID至少选择一个
    :param frequencyCD: 统计周期代码，M-月；A-年,可以是列表,beginDate、endDate、frequencyCD、boardTypeID、shareTypeID至少选择一个
    :param boardTypeID: 板块类别代码，可使用DataAPI.SysCodeGet.codeTypeID=50003获取数字编码,可以是列表,beginDate、endDate、frequencyCD、boardTypeID、shareTypeID至少选择一个
    :param shareTypeID: 股份类别代码，可使用DataAPI.SysCodeGet.codeTypeID=50003获取数字编码,可以是列表,beginDate、endDate、frequencyCD、boardTypeID、shareTypeID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKhrcPro.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&frequencyCD=")
    if hasattr(frequencyCD,'__iter__') and not isinstance(frequencyCD, str):
        if len(frequencyCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = frequencyCD
            requestString.append(None)
        else:
            requestString.append(','.join(frequencyCD))
    else:
        requestString.append(frequencyCD)
    requestString.append("&boardTypeID=")
    if hasattr(boardTypeID,'__iter__') and not isinstance(boardTypeID, str):
        if len(boardTypeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = boardTypeID
            requestString.append(None)
        else:
            requestString.append(','.join(boardTypeID))
    else:
        requestString.append(boardTypeID)
    requestString.append("&shareTypeID=")
    if hasattr(shareTypeID,'__iter__') and not isinstance(shareTypeID, str):
        if len(shareTypeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = shareTypeID
            requestString.append(None)
        else:
            requestString.append(','.join(shareTypeID))
    else:
        requestString.append(shareTypeID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKhrcProGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKhrcProGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'frequencyCD', u'boardTypeID', u'shareTypeID', u'listSecNum', u'marketValue', u'marketValuePct', u'iniRaiseCap', u'listedRaiseCap', u'totalRaiseCap', u'turnoverValue', u'turnoverValuePct', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'frequencyCD': 'str','boardTypeID': 'str','shareTypeID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKshareNameChgGet(secID = "", ticker = "", renamedBfCN = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取港股上市公司股票简称变更情况，包含更名日期，公告日期，更名后简称，更名前简称等。一般在变更日期之前公布。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、renamedBfCN至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、renamedBfCN至少选择一个
    :param renamedBfCN: 更名前中文简称，支持模糊查询,secID、ticker、renamedBfCN至少选择一个
    :param beginDate: 变更日期查询的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 变更日期查询的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKshareNameChg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(renamedBfCN, str) and not isinstance(renamedBfCN, unicode):
        renamedBfCN = str(renamedBfCN)

    requestString.append("&renamedBfCN=%s"%(renamedBfCN))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKshareNameChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKshareNameChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'renamedBfCN', u'renamedBfEN', u'publishDate', u'changeDate', u'renamedAfCN', u'renamedAfEN', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','renamedBfCN': 'str','renamedBfEN': 'str','renamedAfCN': 'str','renamedAfEN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKshszHoldGet(secID = "", ticker = "", tradeCD = "", ticketCode = "", partyName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取沪深港通持股记录，包含持股日期、股份代号、股份名称、于中央结算系统的持股量、占总股数的百分比等。
    
    :param secID: 通联编制的证券编码，可在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、tradeCD、ticketCode至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeCD、ticketCode至少选择一个
    :param tradeCD: 沪深港通交易方向，1-沪港通，2-深港通，3-港股通（沪深），4-港股通（沪），5-港股通（深）,可以是列表,secID、ticker、tradeCD、ticketCode至少选择一个
    :param ticketCode: CCASS股份代号,可以是列表,secID、ticker、tradeCD、ticketCode至少选择一个
    :param partyName: CCASS股份名称，可模糊查询,可以是列表,可空
    :param beginDate: 查询起始日期，格式为“YYYYMMDD”,可空
    :param endDate: 查询截止日期，格式为“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKshszHold.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&tradeCD=")
    if hasattr(tradeCD,'__iter__') and not isinstance(tradeCD, str):
        if len(tradeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeCD
            requestString.append(None)
        else:
            requestString.append(','.join(tradeCD))
    else:
        requestString.append(tradeCD)
    requestString.append("&ticketCode=")
    if hasattr(ticketCode,'__iter__') and not isinstance(ticketCode, str):
        if len(ticketCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticketCode
            requestString.append(None)
        else:
            requestString.append(','.join(ticketCode))
    else:
        requestString.append(ticketCode)
    requestString.append("&partyName=")
    if hasattr(partyName,'__iter__') and not isinstance(partyName, str):
        if len(partyName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyName
            requestString.append(None)
        else:
            requestString.append(','.join(partyName))
    else:
        requestString.append(partyName)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKshszHoldGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKshszHoldGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeCD', u'endDate', u'secID', u'ticker', u'ticketCode', u'partyName', u'partyVol', u'partyPct', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeCD': 'str','secID': 'str','ticker': 'str','ticketCode': 'str','partyName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKshszShareChgGet(secID = "", ticker = "", tradeDate = "", statsFreq = "", field = "", pandas = "1"):
    """
    获取沪深港通北向资金持股占比的变动情况，区间维度包含本周、本月、本季、今年、近一周、近一月、近一季、近一年。此表只保留最新一个交易日的数据，无历史记录。持股占比：于CCASS的持股量占目标市场总股数的百分比。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 交易日期,可以是列表,secID、ticker、tradeDate至少选择一个
    :param statsFreq: 统计周期，“本周”，“本月”，“本季”，“本年”，“近一周”，“近一月”，“近一季”，“近一年”。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKshszShareChg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    requestString.append("&statsFreq=")
    if hasattr(statsFreq,'__iter__') and not isinstance(statsFreq, str):
        if len(statsFreq) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsFreq
            requestString.append(None)
        else:
            requestString.append(','.join(statsFreq))
    else:
        requestString.append(statsFreq)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKshszShareChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKshszShareChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'statsFreq', u'changePct', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','statsFreq': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKshszSymbolGet(secID = "", ticker = "", secShortName = "", field = "", pandas = "1"):
    """
    获取沪深港通标的在中央结算系统的CCASS股份编号，包含通用交易代码、CCASS股份编号、证券简称、面值等。
    
    :param secID: 通联编制的证券编码，可在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、secShortName至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、secShortName至少选择一个
    :param secShortName: 证券简称，可模糊搜索,可以是列表,secID、ticker、secShortName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/HKequity/getHKshszSymbol.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secShortName=")
    if hasattr(secShortName,'__iter__') and not isinstance(secShortName, str):
        if len(secShortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secShortName
            requestString.append(None)
        else:
            requestString.append(','.join(secShortName))
    else:
        requestString.append(secShortName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKshszSymbolGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKshszSymbolGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangCD', u'ticker', u'ccassSymbol', u'secShortName', u'parVal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangCD': 'str','ticker': 'str','ccassSymbol': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RRPBondValuationGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取中债登债券估价收益率，久期，凸性等数据。
    
    :param secID: 证券ID，通联数据编制，全商城唯一标识证券编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 债券交易代码，输入债券在交易所交易代码。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部债券估值数据，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 以交易日期为查询基准，查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 以交易日期为查询基准，查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getRRPBondValuation.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RRPBondValuationGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RRPBondValuationGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'typeID', u'tradeDate', u'exchangeCD', u'yearToMat', u'grossPX', u'AI', u'netPX', u'yield', u'modifiedDuration', u'convexity', u'baseRate', u'spreadDuration', u'spreadConvexity', u'optAdjGrsPX', u'optAdjNetPX', u'optAdjYield', u'optAdjDrt', u'optAdjConvexity', u'optAdjBaseRate', u'optAdjSprdDrt', u'optAdjSprdConv', u'reliability', u'spotDuration', u'spotConvexity', u'optAdjSpotDrt', u'optAdjSpotConv', u'eodGrossPX', u'eodAI', u'amountOutstanding', u'yieldSpread', u'benchmarkYieldCurve', u'absLiqCoef', u'positionPercent', u'relLiqCoef', u'relLiqCoefValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','typeID': 'str','exchangeCD': 'str','reliability': 'str','benchmarkYieldCurve': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __BondValuationCsiGet(secID = "", ticker = "", tradeDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    中证债券估值
    
    :param secID: 通联数据编制的证券唯一标识ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、tradeDate至少选择一个
    :param ticker: 债券交易代码,可以是列表,secID、ticker、tradeDate至少选择一个
    :param tradeDate: 输入一个日期，不输入其他请求参数，可获取到一天全部中证债券估值数据，输入格式“YYYYMMDD”,secID、ticker、tradeDate至少选择一个
    :param beginDate: 以交易日期tradeDate为查询基准，查询开始日期，输入格式：YYYYMMDD,可空
    :param endDate: 以交易日期tradeDate为查询基准，查询截至日期，输入格式：YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondValuationCsi.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__BondValuationCsiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__BondValuationCsiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'tradeDate', u'grossPX', u'YTM', u'modifiedDuration', u'convexity', u'netPX', u'AI']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __BondRrpPoolLatestGet(secID = "", ticker = "", exchangeCD = "", field = "", pandas = "1"):
    """
    债券池最新信息(产品用)。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，XIBE-中国银行间市场；XSHE-深圳证券交易所等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondRrpPoolLatest.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__BondRrpPoolLatestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__BondRrpPoolLatestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'issuer', u'remainSize', u'coupon', u'isOption', u'bondRating', u'issuerRating', u'anticipate', u'cbYtm', u'cbNetPx', u'csiYtm', u'csiNetPx', u'modifiedDuration', u'yearToMat', u'modifiedDurationSrc']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','issuer': 'str','isOption': 'str','bondRating': 'str','issuerRating': 'str','anticipate': 'str','modifiedDurationSrc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __BondConvIssueGet(secID = "", ticker = "", bondID = "", exchangeCD = "", field = "", pandas = "1"):
    """
    记录可转债审核发行的日期。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、bondID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、bondID至少选择一个
    :param bondID: 通联编制的债券编码，同一债券在不同交易市场有同一债券ID,可以是列表,secID、ticker、bondID至少选择一个
    :param exchangeCD: 证券交易市场代码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。可在DataAPI.SysCodeGet接口输入codeTypeID=10002获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvIssue.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&bondID=")
    if hasattr(bondID,'__iter__') and not isinstance(bondID, str):
        if len(bondID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondID
            requestString.append(None)
        else:
            requestString.append(','.join(bondID))
    else:
        requestString.append(bondID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__BondConvIssueGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__BondConvIssueGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'partyFullName', u'issueMethod', u'advanceDate', u'smDeciPublDate', u'prospIssueDate', u'srcApprPubDate', u'iecApprPubDate', u'coupon', u'bondForm', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','partyFullName': 'str','issueMethod': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __BondTenderDetailGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取债券发行时招标结果情况。包括招标日、计划发行量、实际发行量和投标家数等信息
    
    :param secID: 证券内部编码，可在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 招标日查询起始日期,格式为YYYYMMDD,可空
    :param endDate: 招标日查询截止日期,格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondTenderDetail.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__BondTenderDetailGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__BondTenderDetailGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'bondID', u'bondFullName', u'bondShortName', u'tenderID', u'tenderDate', u'plTenderSize', u'acTenderSize', u'expBidderNum', u'acBidderNum', u'bidNum', u'validBidNum', u'invBidNum', u'validBidAmt', u'highestPx', u'lowestPx', u'bidWinNum', u'bidWinLotNum', u'finalHighPX', u'finalLowPX', u'bidAmtAtTendPx', u'avaAmtAtTendPx', u'tenderPar', u'tenderCoupon', u'tenderRate', u'totalIssuedCap', u'guarTenderAmt', u'tenderAmt', u'tenderedAmt', u'bidAskMultiplier', u'pryDealerTendAmt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','bondFullName': 'str','bondShortName': 'str','tenderID': 'str','tenderDate': 'str','plTenderSize': 'str','acTenderSize': 'str','expBidderNum': 'str','acBidderNum': 'str','bidNum': 'str','validBidNum': 'str','invBidNum': 'str','validBidAmt': 'str','bidWinNum': 'str','bidWinLotNum': 'str','bidAmtAtTendPx': 'str','avaAmtAtTendPx': 'str','totalIssuedCap': 'str','guarTenderAmt': 'str','tenderAmt': 'str','tenderedAmt': 'str','pryDealerTendAmt': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondGet(secID = "", ticker = "", typeID = "", exchangeCD = "", partyID = "", listStatusCD = "", delistDate = "", field = "", pandas = "1"):
    """
    债券的基本面信息，涵盖了债券计息方式、付息频率、起息日、到期日、兑付形式等。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param typeID: 债券分类ID。例如，02020101-国债；0202010201-央行票据。对应DataAPI.SysCodeGet.codeTypeID=30018。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，XIBE-中国银行间市场；XSHE-深圳证券交易所等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param partyID: 输入发行人ID，可得到该发行人发行的债券列表,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param delistDate: 退市日期，输入“YYYYMMDD”返回截至（含）输入日期的所有已退市（已到期）债券信息,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBond.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    requestString.append("&delistDate=")
    if hasattr(delistDate,'__iter__') and not isinstance(delistDate, str):
        if len(delistDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = delistDate
            requestString.append(None)
        else:
            requestString.append(','.join(delistDate))
    else:
        requestString.append(delistDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'bondID', u'secFullName', u'secShortName', u'listStatusCD', u'partyID', u'issuer', u'totalSize', u'remainSize', u'currencyCD', u'couponTypeCD', u'cpnFreqCD', u'paymentCD', u'coupon', u'par', u'hybridCD', u'typeID', u'typeName', u'publishDate', u'listDate', u'delistDate', u'actMaturityDate', u'firstAccrDate', u'maturityDate', u'firstRedempDate', u'minCoupon', u'frnRefRateCD', u'frnCurrBmkRate', u'frnMargin', u'privPlacemFlag', u'issueInvNum', u'privInvNum', u'isOption', u'absIssuerID', u'absIssuer', u'absLevelCD', u'absLevelRatio', u'absCouponCap']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','secFullName': 'str','secShortName': 'str','listStatusCD': 'str','issuer': 'str','currencyCD': 'str','couponTypeCD': 'str','cpnFreqCD': 'str','paymentCD': 'str','hybridCD': 'str','typeID': 'str','typeName': 'str','frnRefRateCD': 'str','absIssuer': 'str','absLevelCD': 'str','absCouponCap': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondAiGet(secID = "", ticker = "", dataDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    债券在一个日期区间的每日应计利息。 日期区间默认是过去一年。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、dataDate至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、dataDate至少选择一个
    :param dataDate: 日期，格式为YYYYMMDD,secID、ticker、dataDate至少选择一个
    :param beginDate: 计息起始日，默认为1年前，输入格式“YYYYMMDD”,可空
    :param endDate: 计息截止日，默认为今天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondAi.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        dataDate = dataDate.strftime('%Y%m%d')
    except:
        dataDate = dataDate.replace('-', '')
    requestString.append("&dataDate=%s"%(dataDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondAiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondAiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'dataDate', u'perAccrDate', u'days', u'AI', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondCfGet(secID = "", ticker = "", beginDate = "", endDate = "", cashTypeCD = "", field = "", pandas = "1"):
    """
    债券在每个计息周期付息兑付的相关数据。日期区间默认为过去一年。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 现金流起始日，默认为1年前，输入格式“YYYYMMDD”,可空
    :param endDate: 现金流截止日，输入格式“YYYYMMDD”,可空
    :param cashTypeCD: 现金流类型，默认为INTPAY。INTPAY-付息；CAPINTPAY-还本付息。对应DataAPI.SysCodeGet.codeTypeID=30014。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondCf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&cashTypeCD=")
    if hasattr(cashTypeCD,'__iter__') and not isinstance(cashTypeCD, str):
        if len(cashTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = cashTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(cashTypeCD))
    else:
        requestString.append(cashTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondCfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondCfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'paymentDate', u'ticker', u'exchangeCD', u'bondID', u'secShortName', u'cashTypeCD', u'perAccrDate', u'perAccrEndDate', u'recordDate', u'exDivDate', u'interest', u'payment', u'totalSize']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','secShortName': 'str','cashTypeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondCouponGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    固定利率债券、浮动利率债券每个计息周期的票面利率，包括分段计息的具体利率。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondCoupon.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondCouponGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondCouponGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'perValueDate', u'ticker', u'exchangeCD', u'secShortName', u'bondID', u'perValueEndDate', u'refRatePer', u'refRateDate', u'stepMargin', u'coupon', u'perAccrDate', u'perAccrEndDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','bondID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondGuarGet(secID = "", ticker = "", guarModeCD = "", field = "", pandas = "1"):
    """
    收录债券担保信息，如担保人、担保类型、担保方式、担保期限等。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param guarModeCD: 担保方式,默认为0101-保证担保。例如，0103-质押担保；0104-留置担保。对应DataAPI.SysCodeGet.codeTypeID=30012。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondGuar.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&guarModeCD=")
    if hasattr(guarModeCD,'__iter__') and not isinstance(guarModeCD, str):
        if len(guarModeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = guarModeCD
            requestString.append(None)
        else:
            requestString.append(','.join(guarModeCD))
    else:
        requestString.append(guarModeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondGuarGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondGuarGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'beginDate', u'ticker', u'exchangeCD', u'bondID', u'secShortName', u'guarID', u'guar', u'endDate', u'guarModeCD', u'assureGuaCD', u'guarRange', u'guarTypeCD', u'publishDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','secShortName': 'str','guar': 'str','guarModeCD': 'str','assureGuaCD': 'str','guarRange': 'str','guarTypeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondIssueGet(secID = "", ticker = "", raiseModeCD = "", field = "", pandas = "1"):
    """
    债券在一级市场发行信息，记录的要素包括有发行方式、发行价格、当次发行规模等
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param raiseModeCD: 募集方式，默认为PUB。PUB-公募，PRIV-私募。对应DataAPI.SysCodeGet.codeTypeID=30008。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondIssue.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(raiseModeCD, str) and not isinstance(raiseModeCD, unicode):
        raiseModeCD = str(raiseModeCD)

    requestString.append("&raiseModeCD=%s"%(raiseModeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondIssueGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondIssueGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'issueDate', u'ticker', u'exchangeCD', u'bondID', u'secShortName', u'raiseModeCD', u'issueNum', u'issuePrice', u'issueSize', u'ytmAtIssue', u'auctionDate', u'firstSettlDate', u'recordDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','secShortName': 'str','raiseModeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondOptionGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    记录债券赎回回售等选择权结果，包括跨市场债券各市场的行权记录。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondOption.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondOptionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondOptionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'bondID', u'secShortName', u'optionCD', u'publishDate', u'exerDate', u'exerPar', u'isContaIntePar', u'exerLowAmut', u'appStartDate', u'appEndDate', u'payDate', u'appCode', u'appShortName', u'optionAmut', u'contaInte', u'restAmut', u'resaleAmut', u'stepMargin', u'couponChg', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','secShortName': 'str','optionCD': 'str','appShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondRatingGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    债券的长期评级、短期评级以及历史评级变动记录。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 评级起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 评级结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondRating.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondRatingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondRatingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ratingDate', u'ticker', u'exchangeCD', u'bondID', u'secShortName', u'publishDate', u'rating', u'ratComID', u'ratCom', u'ratTypeCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','secShortName': 'str','rating': 'str','ratCom': 'str','ratTypeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def GuarRatingGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    各评级机构公布的债券担保人的信用评级数据及历史变动记录。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 评级起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 评级结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getGuarRating.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'GuarRatingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'GuarRatingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ratingDate', u'ticker', u'exchangeCD', u'secShortName', u'partyID', u'partyFullName', u'rating', u'publishDate', u'ratComID', u'ratCom', u'anticipateCD', u'creditTypeCD', u'lastRating', u'lastAntiCD', u'ratChgDir']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','partyFullName': 'str','rating': 'str','ratCom': 'str','creditTypeCD': 'str','lastRating': 'str','ratChgDir': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IssuerRatingGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    各评级机构公布的债券发行人的信用评级数据及历史变动记录。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 发行人ID,可以是列表,secID、ticker、partyID至少选择一个
    :param beginDate: 评级起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 评级结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getIssuerRating.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IssuerRatingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IssuerRatingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ratingDate', u'ticker', u'exchangeCD', u'partyID', u'secShortName', u'partyFullName', u'rating', u'publishDate', u'ratComID', u'ratCom', u'anticipateCD', u'creditTypeCD', u'lastRating', u'lastAntiCD', u'ratChgDir']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','partyFullName': 'str','rating': 'str','ratCom': 'str','creditTypeCD': 'str','lastRating': 'str','ratChgDir': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RepoGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    债券回购基本面信息，涵盖了回购交易代码、回购期限、申报价格最小变动单位(RMB)、申报参与价格单位(RMB)等。
    
    :param secID: 证券ID，证券统一编码，可通过交易代码在DataAPI.SecIDGet获取到。,可以是列表,可空
    :param ticker: 回购交易代码，如'204001',可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getRepo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RepoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RepoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'exCountryCD', u'secFullName', u'secShortName', u'maturity', u'repoTypeCD', u'repoType', u'interestBaseDays', u'minQuoteUnit', u'priceUnit', u'listStatusCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','exCountryCD': 'str','secFullName': 'str','secShortName': 'str','repoTypeCD': 'str','repoType': 'str','listStatusCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvPriceChgGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    1、存储可转债发行时约定的初始转股价格，以及历次转股价格变动记录； 2、历史数据追溯至1992年，每日更新。
    
    :param secID: 证券ID，通联数据编制，全商城唯一标识证券编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可空
    :param ticker: 债券交易代码，输入可转债在交易所交易代码。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvPriceChg.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvPriceChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvPriceChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'secShortName', u'equSecID', u'equTicker', u'equShortName', u'convCode', u'convShortName', u'convPrice', u'convDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','secShortName': 'str','equSecID': 'str','equTicker': 'str','equShortName': 'str','convCode': 'str','convShortName': 'str','convDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondSizeChgGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    记录债券的存量变动情况。
    
    :param secID: 证券ID，通联数据编制，全商城唯一标识证券编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,secID、ticker至少选择一个
    :param ticker: 债券交易代码，输入债券在交易所交易代码。,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondSizeChg.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondSizeChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondSizeChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'secShortName', u'publishDate', u'changeDate', u'changeSize', u'remainSize', u'changeReasonCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','secShortName': 'str','publishDate': 'str','changeDate': 'str','changeReasonCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondAiHSGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    正在上市的沪深债券截至到查询当日的应计利息。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param beginDate: 计息起始日，默认为1年前，输入格式“YYYYMMDD”,可空
    :param endDate: 计息截止日，默认为今天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondAiHS.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondAiHSGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondAiHSGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'dataDate', u'ticker', u'exchangeCD', u'AI', u'secShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondTickerGet(secID = "", ticker = "", bondID = "", exchangeCD = "", field = "", pandas = "1"):
    """
    1、针对同一债券在不同市场的交易代码不统一的问题，设置了“债券ID（BOND_ID）”，同一债券有一个统一的BOND_ID，不随交易市场而改变；2、同一债券在不同交易市场交易，对应不同的“证券内部ID（SECURITY_ID）”；3、通过对“证券市场（EXCHANGE_CD）”的选择，可以得到债券在该市场上的交易代码、交易简称、债券内部编码等。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、bondID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、bondID至少选择一个
    :param bondID: 通联编制的债券编码，同一债券在不同交易市场有同一债券ID,可以是列表,secID、ticker、bondID至少选择一个
    :param exchangeCD: 证券交易市场代码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。可在DataAPI.SysCodeGet接口输入codeTypeID=10002获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondTicker.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&bondID=")
    if hasattr(bondID,'__iter__') and not isinstance(bondID, str):
        if len(bondID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondID
            requestString.append(None)
        else:
            requestString.append(','.join(bondID))
    else:
        requestString.append(bondID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondTickerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondTickerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secFullName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvDetailGet(secID = "", ticker = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    记录可转换债券每次转股时的转股金额、转股数量、对应转股价、累计转股金额等信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 最新公告日起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 最新公告日截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param exchangeCD: 证券交易市场代码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。可在DataAPI.SysCodeGet接口输入codeTypeID=10002获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvDetail.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvDetailGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvDetailGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'endDate', u'convPrice', u'convAmount', u'convVolume', u'convNumber', u'totalConvAmount', u'totalConvVolume', u'totalConvNumber', u'totalConvRatio', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvPlaceDtlGet(bondID = "", secID = "", ticker = "", beginDate = "", endDate = "", orderID = "", exchangeCD = "", field = "", pandas = "1"):
    """
    记录可转债发行配售的明细情况。
    
    :param bondID: 通联编制的债券代码，同一债券在不同交易市场有同一债券ID，可通过getBondTicker接口输入ticker获取到,可以是列表,bondID、secID、ticker、beginDate、endDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,bondID、secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,bondID、secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 最新公告日起始日期，输入格式“YYYYMMDD”,bondID、secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 最新公告日截止日期，输入格式“YYYYMMDD”,bondID、secID、ticker、beginDate、endDate至少选择一个
    :param orderID: 序号,可以是列表,可空
    :param exchangeCD: 证券交易市场代码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。可在DataAPI.SysCodeGet接口输入codeTypeID=10002获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvPlaceDtl.csv?ispandas=1&') 
    requestString.append("bondID=")
    if hasattr(bondID,'__iter__') and not isinstance(bondID, str):
        if len(bondID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondID
            requestString.append(None)
        else:
            requestString.append(','.join(bondID))
    else:
        requestString.append(bondID)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&orderID=")
    if hasattr(orderID,'__iter__') and not isinstance(orderID, str):
        if len(orderID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = orderID
            requestString.append(None)
        else:
            requestString.append(','.join(orderID))
    else:
        requestString.append(orderID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvPlaceDtlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvPlaceDtlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'exchangeCD', u'secFullName', u'orderID', u'publishDate', u'partyFullName', u'partyID', u'placeAmt', u'returnAmt', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secFullName': 'str','partyFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondShClearingDGet(beginDate = "", endDate = "", businessTypeCode = "", productTypeCode = "", statisticsTypeCode = "", itemTypeCode = "", field = "", pandas = "1"):
    """
    记录清算所公布的日统计数据。
    
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param businessTypeCode: 业务类型代码。1-登记托管业务，2-清算结算业务，3-发行托管业务,可以是列表,可空
    :param productTypeCode: 产品种类代码，如：01-短期融资券，09-同业存单，可在DataAPI.SysCodeGet接口输入codeTypeID=30036获取到,可以是列表,可空
    :param statisticsTypeCode: 统计项目代码，如：1-数量，2-面值总额，可在DataAPI.SysCodeGet接口输入codeTypeID=30037获取到,可以是列表,可空
    :param itemTypeCode: 项目类型代码，如：1-当日增减，10-当月发行，可在DataAPI.SysCodeGet接口输入codeTypeID=30038获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondShClearingD.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&businessTypeCode=")
    if hasattr(businessTypeCode,'__iter__') and not isinstance(businessTypeCode, str):
        if len(businessTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = businessTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(businessTypeCode))
    else:
        requestString.append(businessTypeCode)
    requestString.append("&productTypeCode=")
    if hasattr(productTypeCode,'__iter__') and not isinstance(productTypeCode, str):
        if len(productTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = productTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(productTypeCode))
    else:
        requestString.append(productTypeCode)
    requestString.append("&statisticsTypeCode=")
    if hasattr(statisticsTypeCode,'__iter__') and not isinstance(statisticsTypeCode, str):
        if len(statisticsTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statisticsTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(statisticsTypeCode))
    else:
        requestString.append(statisticsTypeCode)
    requestString.append("&itemTypeCode=")
    if hasattr(itemTypeCode,'__iter__') and not isinstance(itemTypeCode, str):
        if len(itemTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(itemTypeCode))
    else:
        requestString.append(itemTypeCode)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondShClearingDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondShClearingDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'businessType', u'productType', u'statisticsType', u'itemType', u'data', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'businessType': 'str','productType': 'str','statisticsType': 'str','itemType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondShClearingMGet(beginDate = "", endDate = "", businessTypeCode = "", productTypeCode = "", statisticsTypeCode = "", itemTypeCode = "", invStrCD = "", field = "", pandas = "1"):
    """
    记录清算所公布的月统计数据。
    
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param businessTypeCode: 业务类型代码。1-业务总览，2-发行量，3-兑付金额，4-托管量，5-投资者持有结构,可以是列表,可空
    :param productTypeCode: 产品种类代码，如：01-本币债券发行量，16-同业存单，可在DataAPI.SysCodeGet接口输入codeTypeID=30040获取到,可以是列表,可空
    :param statisticsTypeCode: 统计区间代码，如：1-本月，10-本月新增，可在DataAPI.SysCodeGet接口输入codeTypeID=30041获取到,可以是列表,可空
    :param itemTypeCode: 项目类型代码，1-只数/笔数，3-只数，7-发行面额（亿），8-提前兑付面额（亿），9-到期兑付面额（亿），10-面额(亿),可以是列表,可空
    :param invStrCD: 投资者持有结构代码，如：01-合计，03-商业银行，04-非银行类金融机构，可在DataAPI.SysCodeGet接口输入codeTypeID=30043获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondShClearingM.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&businessTypeCode=")
    if hasattr(businessTypeCode,'__iter__') and not isinstance(businessTypeCode, str):
        if len(businessTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = businessTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(businessTypeCode))
    else:
        requestString.append(businessTypeCode)
    requestString.append("&productTypeCode=")
    if hasattr(productTypeCode,'__iter__') and not isinstance(productTypeCode, str):
        if len(productTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = productTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(productTypeCode))
    else:
        requestString.append(productTypeCode)
    requestString.append("&statisticsTypeCode=")
    if hasattr(statisticsTypeCode,'__iter__') and not isinstance(statisticsTypeCode, str):
        if len(statisticsTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statisticsTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(statisticsTypeCode))
    else:
        requestString.append(statisticsTypeCode)
    requestString.append("&itemTypeCode=")
    if hasattr(itemTypeCode,'__iter__') and not isinstance(itemTypeCode, str):
        if len(itemTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(itemTypeCode))
    else:
        requestString.append(itemTypeCode)
    requestString.append("&invStrCD=")
    if hasattr(invStrCD,'__iter__') and not isinstance(invStrCD, str):
        if len(invStrCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = invStrCD
            requestString.append(None)
        else:
            requestString.append(','.join(invStrCD))
    else:
        requestString.append(invStrCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondShClearingMGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondShClearingMGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'businessType', u'productType', u'statisticsType', u'itemType', u'invStr', u'stData', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'businessType': 'str','productType': 'str','statisticsType': 'str','itemType': 'str','invStr': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondMsChinaMoneyRateGet(beginDate = "", endDate = "", referenceRateCode = "", maturity = "", field = "", pandas = "1"):
    """
    记录外汇交易中心利率互换月统计数据。
    
    :param beginDate: 起始查询日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 截止查询日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param referenceRateCode: 参考利率代码，如1-FR007，4-一年定存利率等，可在DataAPI.SysCodeGet接口输入codeTypeID=30049获取到,可以是列表,可空
    :param maturity: 期限，如“1年”、“1月”、“7日”,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondMsChinaMoneyRate.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&referenceRateCode=")
    if hasattr(referenceRateCode,'__iter__') and not isinstance(referenceRateCode, str):
        if len(referenceRateCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = referenceRateCode
            requestString.append(None)
        else:
            requestString.append(','.join(referenceRateCode))
    else:
        requestString.append(referenceRateCode)
    requestString.append("&maturity=")
    if hasattr(maturity,'__iter__') and not isinstance(maturity, str):
        if len(maturity) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = maturity
            requestString.append(None)
        else:
            requestString.append(','.join(maturity))
    else:
        requestString.append(maturity)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondMsChinaMoneyRateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondMsChinaMoneyRateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'referenceRate', u'maturity', u'fixRate', u'captialAmt', u'tradeNum', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'referenceRate': 'str','maturity': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondMsChinaMoneyTypeGet(beginDate = "", endDate = "", tradeTypeCode = "", classifyTypeCode = "", statisticsTypeCode = "", itemTypeCode = "", field = "", pandas = "1"):
    """
    记录外汇交易中心成交月统计数据。
    
    :param beginDate: 起始查询日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 截止查询日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param tradeTypeCode: 成交类型代码。1-同业拆借，2-质押式回购，3-买断式回购，4-现券买卖,可以是列表,可空
    :param classifyTypeCode: 统计标准代码。1-按交易品种，2-按机构类别交易统计等，可在DataAPI.SysCodeGet接口输入codeTypeID=30047获取到,可以是列表,可空
    :param statisticsTypeCode: 统计指标代码。如010101-IBO001，020101-大型商业银行等，可在DataAPI.SysCodeGet接口输入codeTypeID=30046获取到,可以是列表,可空
    :param itemTypeCode: 项目类型代码。1-成交笔数（笔），2-成交金额（亿元）等，可在DataAPI.SysCodeGet接口输入codeTypeID=30048获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondMsChinaMoneyType.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&tradeTypeCode=")
    if hasattr(tradeTypeCode,'__iter__') and not isinstance(tradeTypeCode, str):
        if len(tradeTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(tradeTypeCode))
    else:
        requestString.append(tradeTypeCode)
    requestString.append("&classifyTypeCode=")
    if hasattr(classifyTypeCode,'__iter__') and not isinstance(classifyTypeCode, str):
        if len(classifyTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = classifyTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(classifyTypeCode))
    else:
        requestString.append(classifyTypeCode)
    requestString.append("&statisticsTypeCode=")
    if hasattr(statisticsTypeCode,'__iter__') and not isinstance(statisticsTypeCode, str):
        if len(statisticsTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statisticsTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(statisticsTypeCode))
    else:
        requestString.append(statisticsTypeCode)
    requestString.append("&itemTypeCode=")
    if hasattr(itemTypeCode,'__iter__') and not isinstance(itemTypeCode, str):
        if len(itemTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(itemTypeCode))
    else:
        requestString.append(itemTypeCode)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondMsChinaMoneyTypeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondMsChinaMoneyTypeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'tradeType', u'classifyType', u'statisticsType', u'itemType', u'chinamoneyData', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeType': 'str','classifyType': 'str','statisticsType': 'str','itemType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondMsChinaMoneyAreaGet(beginDate = "", endDate = "", tradeTypeCode = "", area = "", field = "", pandas = "1"):
    """
    记录外汇交易中心地区月统计数据。
    
    :param beginDate: 起始查询日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 截止查询日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param tradeTypeCode: 成交类型代码。1-同业拆借，2-质押式回购，3-买断式回购，4-现券买卖,可以是列表,可空
    :param area: 地区。如‘北京市’、‘宁夏回族自治区’,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondMsChinaMoneyArea.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&tradeTypeCode=")
    if hasattr(tradeTypeCode,'__iter__') and not isinstance(tradeTypeCode, str):
        if len(tradeTypeCode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeTypeCode
            requestString.append(None)
        else:
            requestString.append(','.join(tradeTypeCode))
    else:
        requestString.append(tradeTypeCode)
    requestString.append("&area=")
    if hasattr(area,'__iter__') and not isinstance(area, str):
        if len(area) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = area
            requestString.append(None)
        else:
            requestString.append(','.join(area))
    else:
        requestString.append(area)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondMsChinaMoneyAreaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondMsChinaMoneyAreaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'tradeType', u'area', u'intoAmt', u'intoRate', u'outAmt', u'outRate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeType': 'str','area': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvExpGet(secucode = "", secID = "", ticker = "", secShortName = "", exchangeCD = "", field = "", pandas = "1"):
    """
    记录可转债从发行预案开始到正式发行资料。
    
    :param secucode: 发行人股票代码,可以是列表,secucode、secID、ticker、secShortName至少选择一个
    :param secID: 发行债券的证券编码，通联编制。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secucode、secID、ticker、secShortName至少选择一个
    :param ticker: 发行债券在证券市场通用的交易代码。,可以是列表,secucode、secID、ticker、secShortName至少选择一个
    :param secShortName: 债券简称,可以是列表,secucode、secID、ticker、secShortName至少选择一个
    :param exchangeCD: 债券发行的证券交易市场代码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。可在DataAPI.SysCodeGet接口输入codeTypeID=10002获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvExp.csv?ispandas=1&') 
    requestString.append("secucode=")
    if hasattr(secucode,'__iter__') and not isinstance(secucode, str):
        if len(secucode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secucode
            requestString.append(None)
        else:
            requestString.append(','.join(secucode))
    else:
        requestString.append(secucode)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secShortName=")
    if hasattr(secShortName,'__iter__') and not isinstance(secShortName, str):
        if len(secShortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secShortName
            requestString.append(None)
        else:
            requestString.append(','.join(secShortName))
    else:
        requestString.append(secShortName)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvExpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvExpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secucode', u'secID', u'secuname', u'ticker', u'issueMethod', u'bondID', u'secShortName', u'exchangeCD', u'issueSize', u'maturity', u'masterUnder', u'eventProcess', u'advanceDate', u'gmPubDate', u'srcAdopDate', u'srcAppDate', u'publishDate', u'capDes', u'initialConvPriceDes', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secucode': 'str','secID': 'str','secuname': 'str','ticker': 'str','issueMethod': 'str','bondID': 'str','secShortName': 'str','exchangeCD': 'str','masterUnder': 'str','eventProcess': 'str','capDes': 'str','initialConvPriceDes': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvReviseItemGet(secID = "", ticker = "", bondID = "", field = "", pandas = "1"):
    """
    记录可转债发行时修正条款。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、bondID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、bondID至少选择一个
    :param bondID: 通联编制的债券代码，同一债券在不同交易市场有同一债券ID，可通过getBondTicker接口输入ticker获取到,可以是列表,secID、ticker、bondID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvReviseItem.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&bondID=")
    if hasattr(bondID,'__iter__') and not isinstance(bondID, str):
        if len(bondID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondID
            requestString.append(None)
        else:
            requestString.append(','.join(bondID))
    else:
        requestString.append(bondID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvReviseItemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvReviseItemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'conPriceRatio', u'revisePro', u'startDate', u'endDate', u'useNum', u'conditionDays', u'reachDays', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','useNum': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvStockItemGet(secID = "", ticker = "", bondID = "", convID = "", field = "", pandas = "1"):
    """
    记录可转债发行时转股条款。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、bondID、convID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、bondID、convID至少选择一个
    :param bondID: 通联编制的债券代码，同一债券在不同交易市场有同一债券ID，可通过getBondTicker接口输入ticker获取到,可以是列表,secID、ticker、bondID、convID至少选择一个
    :param convID: 转股代码(证券市场通用代码),可以是列表,secID、ticker、bondID、convID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvStockItem.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&bondID=")
    if hasattr(bondID,'__iter__') and not isinstance(bondID, str):
        if len(bondID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondID
            requestString.append(None)
        else:
            requestString.append(','.join(bondID))
    else:
        requestString.append(bondID)
    requestString.append("&convID=")
    if hasattr(convID,'__iter__') and not isinstance(convID, str):
        if len(convID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = convID
            requestString.append(None)
        else:
            requestString.append(','.join(convID))
    else:
        requestString.append(convID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvStockItemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvStockItemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'convID', u'convName', u'convStarttime', u'convEndtime', u'convStoptime', u'convPriceItem', u'forceConvItem', u'convDivItem', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','convID': 'str','convName': 'str','convPriceItem': 'str','forceConvItem': 'str','convDivItem': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvPutTriggerGet(secID = "", ticker = "", exerMethod = "", field = "", pandas = "1"):
    """
    记录可转债回售条款触发信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param exerMethod: 行使方式,1-随时赎回，2-每计息年度1次,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvPutTrigger.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exerMethod=")
    if hasattr(exerMethod,'__iter__') and not isinstance(exerMethod, str):
        if len(exerMethod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exerMethod
            requestString.append(None)
        else:
            requestString.append(','.join(exerMethod))
    else:
        requestString.append(exerMethod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvPutTriggerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvPutTriggerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exerPar', u'exerMethod', u'startDate', u'endDate', u'triggerRate', u'triggerDays', u'triggerReachDays', u'isContaIntePar', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvCallTriggerGet(secID = "", ticker = "", exerMethod = "", field = "", pandas = "1"):
    """
    记录可转债赎回条款触发信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param exerMethod: 行使方式,1-随时赎回，2-每计息年度1次,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvCallTrigger.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exerMethod=")
    if hasattr(exerMethod,'__iter__') and not isinstance(exerMethod, str):
        if len(exerMethod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exerMethod
            requestString.append(None)
        else:
            requestString.append(','.join(exerMethod))
    else:
        requestString.append(exerMethod)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvCallTriggerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvCallTriggerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exerPar', u'exerMethod', u'startDate', u'endDate', u'triggerRate', u'triggerDays', u'triggerReachDays', u'isContaIntePar', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondVarShClearingGet(secID = "", ticker = "", beginDate = "", endDate = "", holdingPeriod = "", confidenceLevel = "", field = "", pandas = "1"):
    """
    记录上海清算所公布的VaR与CVaR值数据。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param holdingPeriod: 持有期,可以是列表,可空
    :param confidenceLevel: 置信水平。小数形式，如0.95。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondVarShClearing.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&holdingPeriod=")
    if hasattr(holdingPeriod,'__iter__') and not isinstance(holdingPeriod, str):
        if len(holdingPeriod) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = holdingPeriod
            requestString.append(None)
        else:
            requestString.append(','.join(holdingPeriod))
    else:
        requestString.append(holdingPeriod)
    requestString.append("&confidenceLevel=")
    if hasattr(confidenceLevel,'__iter__') and not isinstance(confidenceLevel, str):
        if len(confidenceLevel) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = confidenceLevel
            requestString.append(None)
        else:
            requestString.append(','.join(confidenceLevel))
    else:
        requestString.append(confidenceLevel)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondVarShClearingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondVarShClearingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'holdingPeriod', u'confidenceLevel', u'var', u'cvar', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondPriceModelGet(partyID = "", valCompany = "", beginDate = "", endDate = "", maturity = "", field = "", pandas = "1"):
    """
    记录交易商协会公布的信用债定价和估值。
    
    :param partyID: 估值机构ID，对应通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,partyID、valCompany、beginDate、endDate至少选择一个
    :param valCompany: 估值机构简称，如“国开行”、“人保资产”，支持模糊查询,可以是列表,partyID、valCompany、beginDate、endDate至少选择一个
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”,partyID、valCompany、beginDate、endDate至少选择一个
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,partyID、valCompany、beginDate、endDate至少选择一个
    :param maturity: 期限（年）,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondPriceModel.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&valCompany=")
    if hasattr(valCompany,'__iter__') and not isinstance(valCompany, str):
        if len(valCompany) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = valCompany
            requestString.append(None)
        else:
            requestString.append(','.join(valCompany))
    else:
        requestString.append(valCompany)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&maturity=")
    if hasattr(maturity,'__iter__') and not isinstance(maturity, str):
        if len(maturity) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = maturity
            requestString.append(None)
        else:
            requestString.append(','.join(maturity))
    else:
        requestString.append(maturity)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondPriceModelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondPriceModelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'partyID', u'valCompany', u'maturity', u'keyAAA', u'AAA', u'AAp', u'AA', u'AAm', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'valCompany': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondYieldCurveShClearingGet(fwdTenorBegin = "", fwdTenorEnd = "", curveName = "", curveCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上海清算所公布的债券收益率曲线数据。
    
    :param fwdTenorBegin: N(年),可以是列表,fwdTenorBegin、fwdTenorEnd、curveName、curveCD、beginDate、endDate至少选择一个
    :param fwdTenorEnd: K(年),可以是列表,fwdTenorBegin、fwdTenorEnd、curveName、curveCD、beginDate、endDate至少选择一个
    :param curveName: 曲线名称，支持模糊查询，如“中短期票据收益率曲线”,可以是列表,fwdTenorBegin、fwdTenorEnd、curveName、curveCD、beginDate、endDate至少选择一个
    :param curveCD: 曲线类型代码，XG00-到期，XG01-即期；XG02-远期的即期，XG03-远期的到期。,可以是列表,fwdTenorBegin、fwdTenorEnd、curveName、curveCD、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,fwdTenorBegin、fwdTenorEnd、curveName、curveCD、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,fwdTenorBegin、fwdTenorEnd、curveName、curveCD、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondYieldCurveShClearing.csv?ispandas=1&') 
    requestString.append("fwdTenorBegin=")
    if hasattr(fwdTenorBegin,'__iter__') and not isinstance(fwdTenorBegin, str):
        if len(fwdTenorBegin) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fwdTenorBegin
            requestString.append(None)
        else:
            requestString.append(','.join(fwdTenorBegin))
    else:
        requestString.append(fwdTenorBegin)
    requestString.append("&fwdTenorEnd=")
    if hasattr(fwdTenorEnd,'__iter__') and not isinstance(fwdTenorEnd, str):
        if len(fwdTenorEnd) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fwdTenorEnd
            requestString.append(None)
        else:
            requestString.append(','.join(fwdTenorEnd))
    else:
        requestString.append(fwdTenorEnd)
    requestString.append("&curveName=")
    if hasattr(curveName,'__iter__') and not isinstance(curveName, str):
        if len(curveName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = curveName
            requestString.append(None)
        else:
            requestString.append(','.join(curveName))
    else:
        requestString.append(curveName)
    requestString.append("&curveCD=")
    if hasattr(curveCD,'__iter__') and not isinstance(curveCD, str):
        if len(curveCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = curveCD
            requestString.append(None)
        else:
            requestString.append(','.join(curveCD))
    else:
        requestString.append(curveCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondYieldCurveShClearingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondYieldCurveShClearingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'curveName', u'curveCD', u'curveType', u'dataDt', u'tenor', u'yieldSpread', u'fwdTenorBegin', u'fwdTenorEnd', u'maturityDesc', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'curveName': 'str','curveCD': 'str','curveType': 'str','maturityDesc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondValuationShClearingGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上海清算所公布的债券估值数据。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondValuationShClearing.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondValuationShClearingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondValuationShClearingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeDate', u'exchangeCD', u'yearToMat', u'grossPx', u'AI', u'netPx', u'YTM', u'modifiedDuration', u'convexity', u'baseRate', u'spreadDuration', u'spreadConvexity', u'optAdjGrsPx', u'optAdjNetPx', u'optAdjYield', u'optAdjDrt', u'optAdjConvexity', u'optAdjBaseRate', u'optAdjSprdDrt', u'optAdjAprdConv', u'reliability', u'spotDuration', u'spotConvexity', u'optAdjSpotDrt', u'optAdjSpotConv', u'eodGrossPx', u'eodAi', u'amountOutstanding', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','reliability': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvIssueNewGet(secID = "", ticker = "", bondID = "", exchangeCD = "", field = "", pandas = "1"):
    """
    记录可转债审核发行的日期。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、bondID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、bondID至少选择一个
    :param bondID: 通联编制的债券编码，同一债券在不同交易市场有同一债券ID,可以是列表,secID、ticker、bondID至少选择一个
    :param exchangeCD: 证券交易市场代码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所。可在DataAPI.SysCodeGet接口输入codeTypeID=10002获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConvIssueNew.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&bondID=")
    if hasattr(bondID,'__iter__') and not isinstance(bondID, str):
        if len(bondID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondID
            requestString.append(None)
        else:
            requestString.append(','.join(bondID))
    else:
        requestString.append(bondID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvIssueNewGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvIssueNewGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'partyFullName', u'issueMethod', u'advanceDate', u'smDeciPublDate', u'prospIssueDate', u'srcApprPubDate', u'iecApprPubDate', u'coupon', u'bondForm']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','partyFullName': 'str','issueMethod': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondConvGet(bondID = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录可转债基本资料。
    
    :param bondID: 通联编制的债券编码，同一债券在不同交易市场有同一债券ID,可以是列表,bondID、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,bondID、secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,bondID、secID、ticker至少选择一个
    :param beginDate: 发行公告日起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 发行公告日截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondConv.csv?ispandas=1&') 
    requestString.append("bondID=")
    if hasattr(bondID,'__iter__') and not isinstance(bondID, str):
        if len(bondID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondID
            requestString.append(None)
        else:
            requestString.append(','.join(bondID))
    else:
        requestString.append(bondID)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondConvGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondConvGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'secuCode', u'prePlaceCode', u'prePlaceName', u'onlinePlaceCode', u'onlinePlaceName', u'prePlaceAmt', u'onlineIssueSize', u'onlinePlaceValidAmt', u'offlineIssueSize', u'leadunderSize', u'totalIssueCost', u'publicAnnounceDate', u'resultDate', u'listPublishDate', u'prePlaceRecordDate', u'prePlacePayStartdate', u'prePlacePayEndtdate', u'prePlacePre', u'prePlaceUnit', u'prePlaceValidAmt', u'prePlaceValidNum', u'prePlaceOversub', u'prePlaceSuccRatio', u'onlineIssueTime', u'onlinePlaceUnit', u'onlinePlaceMax', u'onlinePlaceMin', u'onlinePlaceValidNum', u'onlinePlaceOversub', u'onlinePlaceSuccRate', u'offlinePlaceUnit', u'offlinePlaceMax', u'offlinePlaceMin', u'depositRatio', u'offlinePlaceValidAmt', u'offlinePlaceValidNum', u'offlinePlaceOversub', u'offlinePlaceSuccRatio', u'cpnFreqDes', u'initialConvPrice', u'initialConvPriceDes', u'redeemInt', u'redeemCoupon', u'redeemIntDes', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','secuCode': 'str','prePlaceCode': 'str','prePlaceName': 'str','onlinePlaceCode': 'str','onlinePlaceName': 'str','cpnFreqDes': 'str','initialConvPriceDes': 'str','redeemIntDes': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondGuarNewGet(secID = "", ticker = "", bondID = "", guarTypeCD = "", field = "", pandas = "1"):
    """
    记录债券担保信息，如担保人、担保类型、担保方式、担保期限等。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、bondID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、bondID至少选择一个
    :param bondID: 通联编制的债券编码，同一债券在不同交易市场有同一债券ID,可以是列表,secID、ticker、bondID至少选择一个
    :param guarTypeCD: 担保类型，如1-一般保证担保，3-抵押担保。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondGuarNew.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&bondID=")
    if hasattr(bondID,'__iter__') and not isinstance(bondID, str):
        if len(bondID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondID
            requestString.append(None)
        else:
            requestString.append(','.join(bondID))
    else:
        requestString.append(bondID)
    requestString.append("&guarTypeCD=")
    if hasattr(guarTypeCD,'__iter__') and not isinstance(guarTypeCD, str):
        if len(guarTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = guarTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(guarTypeCD))
    else:
        requestString.append(guarTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondGuarNewGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondGuarNewGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bondID', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'publishDate', u'guarTypeCD', u'guarName', u'guarID', u'guarRange', u'beginDate', u'endDate', u'guarRemark', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'bondID': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','guarTypeCD': 'str','guarName': 'str','guarRange': 'str','guarRemark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondTypeGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    债券类型。记录债券的各种分类信息。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondType.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondTypeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondTypeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'bondID', u'bondShortName', u'bondFullName', u'typeID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','bondShortName': 'str','bondFullName': 'str','typeID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondPartiesGet(secID = "", ticker = "", partyType = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取债券发行和相关中介机构等信息，包括当事人名称，起始日期，截止日期等信息。
    
    :param secID: 证券内部编码，可在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、partyType至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、partyType至少选择一个
    :param partyType: 当事人类型，例如,1-债券发行人,2-主承销商等,secID、ticker、partyType至少选择一个
    :param beginDate: 起始日期,格式为"YYYYMMDD",可空
    :param endDate: 截止日期,格式为"YYYYMMDD",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondParties.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(partyType, str) and not isinstance(partyType, unicode):
        partyType = str(partyType)

    requestString.append("&partyType=%s"%(partyType))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondPartiesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondPartiesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'bondID', u'bondShortName', u'partyID', u'partyFullName', u'partyType', u'beginDate', u'endDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','bondShortName': 'str','partyID': 'str','partyFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondHolderGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取可转债持有人信息。包含持有人名称、持有金额和持有比例等数据。
    
    :param secID: 证券内部编码，可在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 截止日期查询起始日期,格式为YYYYMM,可空
    :param endDate: 截止日期查询截止日期,格式为YYYYMM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondHolder.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondHolderGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondHolderGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'bondID', u'bondFullName', u'bondShortName', u'endDate', u'rank', u'holderName', u'partyID', u'holdValue', u'holdVol', u'holdRatio', u'holderNum', u'remainAmt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','bondFullName': 'str','bondShortName': 'str','rank': 'str','holderName': 'str','partyID': 'str','holderNum': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondPledgeCodeGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取质押券代码及简称的信息。包括质押权代码、质押权简称等信息。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondPledgeCode.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondPledgeCodeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondPledgeCodeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangCD', u'bondID', u'bondShortName', u'bondFullName', u'pledgeCode', u'pleShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangCD': 'str','bondID': 'str','bondShortName': 'str','bondFullName': 'str','pledgeCode': 'str','pleShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondGuarDetailGet(secID = "", ticker = "", guarMode = "", field = "", pandas = "1"):
    """
    获取债券担保物的明细情况。包括担保方式、担保物类型、担保物数量和担保物单位等信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可从证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、guarMode至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、guarMode至少选择一个
    :param guarMode: 担保方式,如01-抵押担保。,可以是列表,secID、ticker、guarMode至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondGuarDetail.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&guarMode=")
    if hasattr(guarMode,'__iter__') and not isinstance(guarMode, str):
        if len(guarMode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = guarMode
            requestString.append(None)
        else:
            requestString.append(','.join(guarMode))
    else:
        requestString.append(guarMode)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondGuarDetailGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondGuarDetailGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'bondID', u'bondShortName', u'bondFullName', u'guarMode', u'guarType', u'guarNum', u'guarUnit', u'useRightArea', u'guarValue', u'guarCom', u'guarComID', u'instruction']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','bondShortName': 'str','bondFullName': 'str','guarMode': 'str','guarType': 'str','guarNum': 'str','guarUnit': 'str','guarCom': 'str','guarComID': 'str','instruction': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondItemGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取券特殊条款的信息。包括条款类别、条款代码、行权日等信息。
    
    :param secID: 证券内部编码，可在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondItem.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondItemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondItemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'ticker', u'bondID', u'secShortName', u'secFullName', u'itemCD', u'itemName', u'specialItem', u'exerDate', u'exerNote', u'couponUp', u'counponDown']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','ticker': 'str','bondID': 'str','secShortName': 'str','secFullName': 'str','itemCD': 'str','itemName': 'str','specialItem': 'str','exerNote': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondRepoConvRatioGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取中国证券登记结算公司根据《标准券折算率管理办法》每周计算（或修正）的债券最新标准券折算率。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 开始适用日,格式为"YYYYMMDD",可空
    :param endDate: 结束适用日,格式为"YYYYMMDD",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondRepoConvRatio.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondRepoConvRatioGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondRepoConvRatioGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'ticker', u'bondShortName', u'publishDate', u'beginDate', u'endDate', u'convRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','ticker': 'str','bondShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondDsCmRateSwapGet(beginDate = "", endDate = "", refRateCD = "", maturity = "", field = "", pandas = "1"):
    """
    获取外汇交易中心利率互换日报数据，包括固定利率，名义本金等信息数据。
    
    :param beginDate: 起始查询日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 截止查询日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param refRateCD: 参考利率代码，如1-FR007，4-一年定存利率等，可在DataAPI.SysCodeGet接口输入codeTypeID=30049获取到,可以是列表,可空
    :param maturity: 期限，如“1年”、“1月”,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondDsCmRateSwap.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&refRateCD=")
    if hasattr(refRateCD,'__iter__') and not isinstance(refRateCD, str):
        if len(refRateCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = refRateCD
            requestString.append(None)
        else:
            requestString.append(','.join(refRateCD))
    else:
        requestString.append(refRateCD)
    requestString.append("&maturity=")
    if hasattr(maturity,'__iter__') and not isinstance(maturity, str):
        if len(maturity) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = maturity
            requestString.append(None)
        else:
            requestString.append(','.join(maturity))
    else:
        requestString.append(maturity)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondDsCmRateSwapGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondDsCmRateSwapGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'refRate', u'maturity', u'fixRate', u'captialAmt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'refRate': 'str','maturity': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondCmYieldCurveGet(beginDate = "", endDate = "", curveCD = "", curveTypeCD = "", maturity = "", field = "", pandas = "1"):
    """
    获取外汇交易中心收盘收益率曲线数据。包括曲线类型，曲线名称，收益率等信息。
    
    :param beginDate: 起始查询日期，格式为"YYYYMMDD",可以是列表,beginDate、endDate至少选择一个
    :param endDate: 截止查询日期, 格式为"YYYYMMDD",可以是列表,beginDate、endDate至少选择一个
    :param curveCD: 曲线代码,如01-国债,02-央行票据。可在DataAPI.SysCodeGet接口输入codeTypeID=30072获取。,可空
    :param curveTypeCD: 曲线类型代码,1-到期,2-即期,3-远期,可空
    :param maturity: 期限，例如10.0-十年期，5.0-五年期。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondCmYieldCurve.csv?ispandas=1&') 
    requestString.append("beginDate=")
    if hasattr(beginDate,'__iter__') and not isinstance(beginDate, str):
        if len(beginDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = beginDate
            requestString.append(None)
        else:
            requestString.append(','.join(beginDate))
    else:
        requestString.append(beginDate)
    requestString.append("&endDate=")
    if hasattr(endDate,'__iter__') and not isinstance(endDate, str):
        if len(endDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = endDate
            requestString.append(None)
        else:
            requestString.append(','.join(endDate))
    else:
        requestString.append(endDate)
    if not isinstance(curveCD, str) and not isinstance(curveCD, unicode):
        curveCD = str(curveCD)

    requestString.append("&curveCD=%s"%(curveCD))
    if not isinstance(curveTypeCD, str) and not isinstance(curveTypeCD, unicode):
        curveTypeCD = str(curveTypeCD)

    requestString.append("&curveTypeCD=%s"%(curveTypeCD))
    if not isinstance(maturity, str) and not isinstance(maturity, unicode):
        maturity = str(maturity)

    requestString.append("&maturity=%s"%(maturity))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondCmYieldCurveGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondCmYieldCurveGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'curveName', u'maturity', u'curveType', u'yield']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'curveName': 'str','maturity': 'str','curveType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def Bond2Get(secID = "", ticker = "", typeID = "", exchangeCD = "", partyID = "", listStatusCD = "", delistDate = "", field = "", pandas = "1"):
    """
    债券的基本面信息，涵盖了债券计息方式、付息频率、起息日、到期日、兑付形式等。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param typeID: 债券分类ID。例如，02020101-国债；0202010201-央行票据。对应DataAPI.SysCodeGet.codeTypeID=30018。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，XIBE-中国银行间市场；XSHE-深圳证券交易所等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param partyID: 输入发行人ID，可得到该发行人发行的债券列表,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param listStatusCD: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,secID、ticker、typeID、exchangeCD、partyID、listStatusCD至少选择一个
    :param delistDate: 退市日期，输入“YYYYMMDD”返回截至（含）输入日期的所有已退市（已到期）债券信息,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBond2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&listStatusCD=")
    if hasattr(listStatusCD,'__iter__') and not isinstance(listStatusCD, str):
        if len(listStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCD))
    else:
        requestString.append(listStatusCD)
    requestString.append("&delistDate=")
    if hasattr(delistDate,'__iter__') and not isinstance(delistDate, str):
        if len(delistDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = delistDate
            requestString.append(None)
        else:
            requestString.append(','.join(delistDate))
    else:
        requestString.append(delistDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'Bond2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'Bond2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'bondID', u'secFullName', u'secShortName', u'listStatusCD', u'partyID', u'issuer', u'totalSize', u'remainSize', u'currencyCD', u'couponTypeCD', u'cpnFreqCD', u'paymentCD', u'coupon', u'par', u'hybridCD', u'typeID', u'typeName', u'publishDate', u'listDate', u'delistDate', u'actMaturityDate', u'firstAccrDate', u'maturityDate', u'firstRedempDate', u'minCoupon', u'frnRefRateCD', u'frnCurrBmkRate', u'frnMargin', u'privPlacemFlag', u'issueInvNum', u'privInvNum', u'isOption', u'absIssuerID', u'absIssuer', u'absLevelCD', u'absLevelRatio', u'absCouponCap']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','bondID': 'str','secFullName': 'str','secShortName': 'str','listStatusCD': 'str','issuer': 'str','currencyCD': 'str','couponTypeCD': 'str','cpnFreqCD': 'str','paymentCD': 'str','hybridCD': 'str','typeID': 'str','typeName': 'str','frnRefRateCD': 'str','absIssuer': 'str','absLevelCD': 'str','absCouponCap': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BondIssuerCreditGet(partyID = "", partyShortName = "", field = "", pandas = "1"):
    """
    记录银行等机构给予债券发行人的授信额度情况。包括授信额度、已使用额度等信息。
    
    :param partyID: 机构代码,可以是列表,partyID、partyShortName至少选择一个
    :param partyShortName: 机构简称,支持模糊查询，例如"万科",可以是列表,partyID、partyShortName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/bond/getBondIssuerCredit.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&partyShortName=")
    if hasattr(partyShortName,'__iter__') and not isinstance(partyShortName, str):
        if len(partyShortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyShortName
            requestString.append(None)
        else:
            requestString.append(','.join(partyShortName))
    else:
        requestString.append(partyShortName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BondIssuerCreditGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BondIssuerCreditGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'partyShortName', u'partyFullName', u'publishDate', u'endDate', u'creditAmount', u'usedAmount', u'remainAmount']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyID': 'str','partyShortName': 'str','partyFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundReturnRateGet(secID = "", ticker = "", beginDate = "", endDate = "", returnRateType = "", field = "", pandas = "1"):
    """
    获取基金的回报率数据，包含日回报，成立以来的回报率，今年以来的回报率等。收录了05年以来的历史数据，数据更新频率为日。不输入日期则默认获取近一年以来的历史数据。注：回报率数据以小数形式（非百分数）提供。部分可以同时在场内外交易的基金包含两种回报率：当RETURN_RATE_TYPE为OTC时为场外基金的回报率数据，以净值计算；当RETURN_RATE_TYPE为EXCH时为场内基金的回报率数据，以收盘价计算；不选回报率类型则默认为普通开放式基金场外交易的净值回报率，即OTC。
    
    :param secID: 输入多个证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入多个基金代码，如"000001"。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param returnRateType: 输入一种或两种回报率类型，用","分隔，如"OTC"、"OTC,EXCH"。当RETURN_RATE_TYPE为OTC时为场外基金的回报率数据，以净值计算；当RETURN_RATE_TYPE为EXCH时为场内基金的回报率数据，以收盘价计算；不选默认为普通开放式基金场外交易的净值回报率。对应DataAPI.SysCodeGet.codeTypeID=40029。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundReturnRate.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&returnRateType=")
    if hasattr(returnRateType,'__iter__') and not isinstance(returnRateType, str):
        if len(returnRateType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = returnRateType
            requestString.append(None)
        else:
            requestString.append(','.join(returnRateType))
    else:
        requestString.append(returnRateType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundReturnRateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundReturnRateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'returnRateType', u'returnRateDaily', u'returnRateTotal', u'returnRateYTD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','returnRateType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundNavLatelyGet(field = "", pandas = "1"):
    """
    获取基金(货币型、短期理财债券型除外)近14天内的最新净值信息。数据更新频率为日。
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundNavLately.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundNavLatelyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundNavLatelyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'publishDate', u'endDate', u'nav', u'currencyCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundDivmLatelyGet(field = "", pandas = "1"):
    """
    获取货币型、短期理财债券型基金近14天内的最新收益数据，包含每万份收益，七日年化收益率等信息。数据更新频率为日。
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundDivmLately.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundDivmLatelyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundDivmLatelyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'publishDate', u'endDate', u'nav', u'dailyProfit', u'weeklyYield', u'currencyCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundAumGet(beginDate = "", endDate = "", partyID = "", field = "", pandas = "1"):
    """
    获取某一基金公司在季度末的公募资产管理规模，包含总资产与净资产。数据更新频度为季度。
    
    :param beginDate: 起始日期，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，默认为今天，输入格式“YYYYMMDD”,可空
    :param partyID: 输入一个或多个机构ID，用","分隔。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundAum.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundAumGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundAumGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'partyShortName', u'endDate', u'totalAsset', u'netAsset']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundPerformanceGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金业绩的相关数据，包含基金名称、交易代码、单位净值、累计净值、复权净值、周回报、近一年以来的回报率、近一年以来的周平均回报、近一年波动率（标准差）、夏普比率等数据。收录了2005年以来的历史数据，数据更新频率为日。
    
    :param secID: 输入多个证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入多个基金代码，如"000001"。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundPerformance.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundPerformanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundPerformanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'nav', u'accumNav', u'adjustNav', u'returnRate1W', u'returnRate1Y', u'averageReturnRate', u'stdev', u'sharpeRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundDistinctManagerGet(personID = "", category = "", field = "", pandas = "1"):
    """
    获取基金经理的清单，包含基金经理ID，基金经理名称，管理基金的类型。数据更新频率为不定期。
    
    :param personID: 输入多个基金经理ID,可以是列表,可空
    :param category: 输入多种基金类型，E为股票型，H为混合型（注：一个基金经理可能同时管理股票型基金或混合型基金）。对应DataAPI.SysCodeGet.codeTypeID=40002。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundDistinctManager.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    requestString.append("&category=")
    if hasattr(category,'__iter__') and not isinstance(category, str):
        if len(category) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = category
            requestString.append(None)
        else:
            requestString.append(','.join(category))
    else:
        requestString.append(category)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundDistinctManagerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundDistinctManagerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'category']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','category': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundLeverageMapGet(field = "", pandas = "1"):
    """
    获取母基金与分级基金对照关系，以及配比对数据
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundLeverageMap.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundLeverageMapGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundLeverageMapGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secIDLeverage', u'tickerLeverage', u'exchangeCDLeverage', u'secShortNameLeverage', u'shareProp', u'isConvert', u'minMerge', u'minMergeLeverage', u'minSplit', u'minSplitLeverage', u'isSubM', u'isRedM', u'clearType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secIDLeverage': 'str','tickerLeverage': 'str','exchangeCDLeverage': 'str','secShortNameLeverage': 'str','clearType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundOtcTickerGet(secID = "", otcSecID = "", ticker = "", field = "", pandas = "1"):
    """
    主要记录场内基金场外对应的内部代码
    
    :param secID: 场内证券编码,可以是列表,可空
    :param otcSecID: 场外证券编码,可以是列表,可空
    :param ticker: 交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundOtcTicker.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&otcSecID=")
    if hasattr(otcSecID,'__iter__') and not isinstance(otcSecID, str):
        if len(otcSecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = otcSecID
            requestString.append(None)
        else:
            requestString.append(','.join(otcSecID))
    else:
        requestString.append(otcSecID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundOtcTickerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundOtcTickerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'otcSecID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','otcSecID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundNetValueTGet(secID = "", ticker = "", dataDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    基金每日净值，包含非货币型基金单位净值、累计净值、调整净值；货币型基金7日年化收益、万份收益，以及场内场外对应。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、dataDate至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker、dataDate至少选择一个
    :param dataDate: 输入一个日期，不输入其他请求参数，可获取到一天全部基金净值数据，输入格式“YYYYMMDD”,secID、ticker、dataDate至少选择一个
    :param beginDate: 起始净值日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止净值日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundNetValueT.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        dataDate = dataDate.strftime('%Y%m%d')
    except:
        dataDate = dataDate.replace('-', '')
    requestString.append("&dataDate=%s"%(dataDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundNetValueTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundNetValueTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'endDate', u'publishDate', u'currencyCd', u'NAV', u'accumNAV', u'adjNAV', u'weeklyYield', u'dailyProfit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','currencyCd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundRatingHTGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取海通证券基金评级信息。收录了11年以来的历史数据，数据更新频率为季度。
    
    :param ticker: 交易代码,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param secID: 内部代码,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param beginDate: 起始日期,ticker、secID、beginDate、endDate至少选择一个
    :param endDate: 结束日期,ticker、secID、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundRatingHT.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundRatingHTGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundRatingHTGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'pubDate', u'endDate', u'ratingTypeCD', u'ratingType', u'ratingRiskCD', u'ratingRisk', u'ratingHT']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','ratingTypeCD': 'str','ratingType': 'str','ratingRiskCD': 'str','ratingRisk': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FundTypeGet(ticker = "", secID = "", typeSTD = "", typeID = "", typeName = "", typeIDL1 = "", typeNameL1 = "", field = "", pandas = "1"):
    """
    获取通联招商基金分类。
    
    :param ticker: 交易代码,可以是列表,ticker、secID、typeSTD、typeID、typeName、typeIDL1、typeNameL1至少选择一个
    :param secID: 内部代码,可以是列表,ticker、secID、typeSTD、typeID、typeName、typeIDL1、typeNameL1至少选择一个
    :param typeSTD: 分类标准,ticker、secID、typeSTD、typeID、typeName、typeIDL1、typeNameL1至少选择一个
    :param typeID: 二级分类代码,可以是列表,ticker、secID、typeSTD、typeID、typeName、typeIDL1、typeNameL1至少选择一个
    :param typeName: 二级分类中文,可以是列表,ticker、secID、typeSTD、typeID、typeName、typeIDL1、typeNameL1至少选择一个
    :param typeIDL1: 一级分类代码，0101000000, 股票型基金;0102000000, 债券型基金;0103000000, 混合型基金;0104000000, 货币市场型基金;0105000000, QDII基金;0107000000, 其他类投资基金;0201000000, 封闭式股票型基金;0202000000, 封闭式债券型基金;0203000000, 封闭式混合型基金;0205000000, 封闭式QDII基金;0207000000, 封闭式其他类投资基金,可以是列表,ticker、secID、typeSTD、typeID、typeName、typeIDL1、typeNameL1至少选择一个
    :param typeNameL1: 一级分类中文,可以是列表,ticker、secID、typeSTD、typeID、typeName、typeIDL1、typeNameL1至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundType.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(typeSTD, str) and not isinstance(typeSTD, unicode):
        typeSTD = str(typeSTD)

    requestString.append("&typeSTD=%s"%(typeSTD))
    requestString.append("&typeID=")
    if hasattr(typeID,'__iter__') and not isinstance(typeID, str):
        if len(typeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeID
            requestString.append(None)
        else:
            requestString.append(','.join(typeID))
    else:
        requestString.append(typeID)
    requestString.append("&typeName=")
    if hasattr(typeName,'__iter__') and not isinstance(typeName, str):
        if len(typeName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeName
            requestString.append(None)
        else:
            requestString.append(','.join(typeName))
    else:
        requestString.append(typeName)
    requestString.append("&typeIDL1=")
    if hasattr(typeIDL1,'__iter__') and not isinstance(typeIDL1, str):
        if len(typeIDL1) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeIDL1
            requestString.append(None)
        else:
            requestString.append(','.join(typeIDL1))
    else:
        requestString.append(typeIDL1)
    requestString.append("&typeNameL1=")
    if hasattr(typeNameL1,'__iter__') and not isinstance(typeNameL1, str):
        if len(typeNameL1) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeNameL1
            requestString.append(None)
        else:
            requestString.append(','.join(typeNameL1))
    else:
        requestString.append(typeNameL1)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FundTypeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FundTypeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'typeSTD', u'typeStdName', u'typeID', u'typeName', u'typeIDL1', u'typeNameL1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','typeSTD': 'str','typeStdName': 'str','typeID': 'str','typeName': 'str','typeIDL1': 'str','typeNameL1': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKFundReturnRateGet(secID = "", ticker = "", beginDate = "", endDate = "", returnRateType = "", field = "", pandas = "1"):
    """
    获取香港基金的日回报。
    
    :param secID: 输入多个证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入多个基金代码，如"000001"。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param returnRateType: 输入一种或两种回报率类型，用","分隔，如"OTC"、"OTC,EXCH"。当RETURN_RATE_TYPE为OTC时为场外基金的回报率数据，以净值计算；当RETURN_RATE_TYPE为EXCH时为场内基金的回报率数据，以收盘价计算；不选默认为普通开放式基金场外交易的净值回报率。对应DataAPI.SysCodeGet.codeTypeID=40029。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getHKFundReturnRate.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&returnRateType=")
    if hasattr(returnRateType,'__iter__') and not isinstance(returnRateType, str):
        if len(returnRateType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = returnRateType
            requestString.append(None)
        else:
            requestString.append(','.join(returnRateType))
    else:
        requestString.append(returnRateType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKFundReturnRateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKFundReturnRateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'endDate', u'returnRateDaily', u'returnRateType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','returnRateType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKFundGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取香港基金基本信息
    
    :param secID: 输入多个证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入多个基金代码，如"000001"。,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getHKFund.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKFundGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKFundGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secIDInt', u'secID', u'ticker', u'secShortName', u'lotSize', u'ISIN', u'SEDOL', u'bloombergTicker', u'reutersTicker', u'issueShares', u'benchmarkName', u'benchmarkIDInt', u'benchmarkID', u'benchmarkTicker', u'investMarket', u'investObject', u'investFocus', u'mktMakers', u'relIDXName', u'relIDXIdInt', u'relIDXId', u'relIDXTicker']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','ISIN': 'str','SEDOL': 'str','bloombergTicker': 'str','reutersTicker': 'str','benchmarkName': 'str','benchmarkID': 'str','benchmarkTicker': 'str','investMarket': 'str','investObject': 'str','investFocus': 'str','mktMakers': 'str','relIDXName': 'str','relIDXId': 'str','relIDXTicker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundGet(secID = "", ticker = "", etfLof = "", listStatusCd = "", category = "", idxID = "", idxTicker = "", operationMode = "", field = "", pandas = "1"):
    """
    获取基金的基本档案信息，包含基金名称、交易代码、分级情况、所属类别、保本情况、上市信息、相关机构、投资描述等信息。收录了2005年以来的历史数据，数据更新频率为不定期。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、etfLof、listStatusCd、category、idxID、idxTicker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"，"000001,000003",可以是列表,secID、ticker、etfLof、listStatusCd、category、idxID、idxTicker至少选择一个
    :param etfLof: ETF或LOF型基金。取值为ETF或LOF或为空。对应DataAPI.SysCodeGet.codeTypeID=40004。,secID、ticker、etfLof、listStatusCd、category、idxID、idxTicker至少选择一个
    :param listStatusCd: 上市状态。L-上市；S-暂停；DE-终止上市；UN-未上市。对应DataAPI.SysCodeGet.codeTypeID=10005。,可以是列表,secID、ticker、etfLof、listStatusCd、category、idxID、idxTicker至少选择一个
    :param category: 按投资对象分基金类型。E-股票型，H-混合型，B-债券型，SB-短期理财债券，M-货币型，O-其他。对应DataAPI.SysCodeGet.codeTypeID=40002。,可以是列表,secID、ticker、etfLof、listStatusCd、category、idxID、idxTicker至少选择一个
    :param idxID: 指数型基金跟踪指数，为内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、etfLof、listStatusCd、category、idxID、idxTicker至少选择一个
    :param idxTicker: 指数代码,secID、ticker、etfLof、listStatusCd、category、idxID、idxTicker至少选择一个
    :param operationMode: 基金运作模式。O-开放式，C-封闭式。对应DataAPI.SysCodeGet.codeTypeID=40005。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFund.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(etfLof, str) and not isinstance(etfLof, unicode):
        etfLof = str(etfLof)

    requestString.append("&etfLof=%s"%(etfLof))
    requestString.append("&listStatusCd=")
    if hasattr(listStatusCd,'__iter__') and not isinstance(listStatusCd, str):
        if len(listStatusCd) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listStatusCd
            requestString.append(None)
        else:
            requestString.append(','.join(listStatusCd))
    else:
        requestString.append(listStatusCd)
    requestString.append("&category=")
    if hasattr(category,'__iter__') and not isinstance(category, str):
        if len(category) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = category
            requestString.append(None)
        else:
            requestString.append(','.join(category))
    else:
        requestString.append(category)
    requestString.append("&idxID=")
    if hasattr(idxID,'__iter__') and not isinstance(idxID, str):
        if len(idxID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = idxID
            requestString.append(None)
        else:
            requestString.append(','.join(idxID))
    else:
        requestString.append(idxID)
    if not isinstance(idxTicker, str) and not isinstance(idxTicker, unicode):
        idxTicker = str(idxTicker)

    requestString.append("&idxTicker=%s"%(idxTicker))
    requestString.append("&operationMode=")
    if hasattr(operationMode,'__iter__') and not isinstance(operationMode, str):
        if len(operationMode) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = operationMode
            requestString.append(None)
        else:
            requestString.append(','.join(operationMode))
    else:
        requestString.append(operationMode)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeAbbrName', u'category', u'operationMode', u'indexFund', u'etfLof', u'isQdii', u'isFof', u'isGuarFund', u'guarPeriod', u'guarRatio', u'exchangeCd', u'listStatusCd', u'managerName', u'status', u'establishDate', u'listDate', u'delistDate', u'expireDate', u'managementCompany', u'managementFullName', u'custodian', u'custodianFullName', u'investField', u'investTarget', u'perfBenchmark', u'circulationShares', u'isClass', u'idxID', u'idxTicker', u'idxShortName', u'managementShortName', u'custodianShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','tradeAbbrName': 'str','category': 'str','operationMode': 'str','indexFund': 'str','etfLof': 'str','exchangeCd': 'str','listStatusCd': 'str','managerName': 'str','status': 'str','managementFullName': 'str','custodianFullName': 'str','investField': 'str','investTarget': 'str','perfBenchmark': 'str','idxID': 'str','idxTicker': 'str','idxShortName': 'str','managementShortName': 'str','custodianShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundNavGet(secID = "", ticker = "", dataDate = "", beginDate = "", endDate = "", partyID = "", partyShortName = "", field = "", pandas = "1"):
    """
    获取某只基金的历史净值数据(货币型、短期理财债券型除外),包括了单位份额净值、累计净值与复权净值。收录了2005年以来的历史数据，数据更新频率为日。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、dataDate至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker、dataDate至少选择一个
    :param dataDate: 输入一个日期，不输入其他请求参数，可获取到一天全部基金净值数据，输入格式“YYYYMMDD”,secID、ticker、dataDate至少选择一个
    :param beginDate: 起始净值日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止净值日期，输入格式“YYYYMMDD”,可空
    :param partyID: 基金公司ID，可通过基金公司名称在DataAPI.PartyIDGet获取到,可空
    :param partyShortName: 基金公司简称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundNav.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        dataDate = dataDate.strftime('%Y%m%d')
    except:
        dataDate = dataDate.replace('-', '')
    requestString.append("&dataDate=%s"%(dataDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(partyID, str) and not isinstance(partyID, unicode):
        partyID = str(partyID)

    requestString.append("&partyID=%s"%(partyID))
    if not isinstance(partyShortName, str) and not isinstance(partyShortName, unicode):
        partyShortName = str(partyShortName)

    requestString.append("&partyShortName=%s"%(partyShortName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundNavGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundNavGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'endDate', u'NAV', u'publishDate', u'currencyCd', u'ACCUM_NAV', u'ADJUST_NAV', u'navChg', u'navChgPct', u'adjNavChgPct', u'partyID', u'partyShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','currencyCd': 'str','partyShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundDivmGet(secID = "", ticker = "", dataDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取某只货币型基金或短期理财债券型基金的历史收益情况，包含了每万份收益，七日年化收益率等信息。收录了2005年以来的历史数据，数据更新频率为日。不输入日期则默认获取近一年以来的历史数据。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、dataDate至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker、dataDate至少选择一个
    :param dataDate: 输入一个日期，不输入其他请求参数，可获取到一天全部基金历史收益数据，输入格式“YYYYMMDD”,secID、ticker、dataDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundDivm.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        dataDate = dataDate.strftime('%Y%m%d')
    except:
        dataDate = dataDate.replace('-', '')
    requestString.append("&dataDate=%s"%(dataDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundDivmGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundDivmGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'endDate', u'dailyProfit', u'weeklyYield', u'publishDate', u'currencyCd', u'nav']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','currencyCd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundDivGet(secID = "", ticker = "", adjustedType = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金的净值调整信息，包括基金分红和基金拆分两种调整情况。分红包含每份分红，除息日，分红在投资日；拆分包含份额折算比例，拆分日。收录了2005年以来的历史数据，数据更新频率为不定期。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker至少选择一个
    :param adjustedType: 基金净值调整类型。D-分红，S-拆分，默认为D。对应DataAPI.SysCodeGet.codeTypeID=40007。,可空
    :param beginDate: 起始日期，默认为1年前当前日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，默认为今天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundDiv.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(adjustedType, str) and not isinstance(adjustedType, unicode):
        adjustedType = str(adjustedType)

    requestString.append("&adjustedType=%s"%(adjustedType))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundDivGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundDivGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'adjustedType', u'effectDate', u'dividendAfTax', u'dividendBfTax', u'reinvestDate', u'splitRatio', u'publishDate', u'currencyCd']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','adjustedType': 'str','currencyCd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundAssetsGet(secID = "", ticker = "", reportDate = "", updateTime = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金定期披露的资产配置情况，包含了资产总值、资产净值，以及资产总值中权益类、固定收益类、现金及其他四种资产的市值与占比情况。收录了2005年以来的历史数据，数据更新频率为季度。获取方式支持：1）输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间的资产配置；2）输入reportDate，不输入其他参数，可以查询到输入日期的全部基金资产配置。
    
    :param secID: 证券ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、reportDate、updateTime至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker、reportDate、updateTime至少选择一个
    :param reportDate: 输入一个报告日期，如20141231，不输入其他请求参数，可获取这个报告期全部基金资产配置，输入格式“YYYYMMDD”,secID、ticker、reportDate、updateTime至少选择一个
    :param updateTime: 数据最新一次更新时间,secID、ticker、reportDate、updateTime至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundAssets.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        reportDate = reportDate.strftime('%Y%m%d')
    except:
        reportDate = reportDate.replace('-', '')
    requestString.append("&reportDate=%s"%(reportDate))
    try:
        updateTime = updateTime.strftime('%Y%m%d')
    except:
        updateTime = updateTime.replace('-', '')
    requestString.append("&updateTime=%s"%(updateTime))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundAssetsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundAssetsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'reportDate', u'totalAsset', u'netAsset', u'equityMarketValue', u'bondMarketValue', u'cashMarketValue', u'otherMarketValue', u'equityRatioInTa', u'bondRatioInTa', u'cashRatioInTa', u'otherRatioInTa', u'publishDate', u'currencyCd', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','currencyCd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundHoldingsGet(secID = "", ticker = "", reportDate = "", beginDate = "", endDate = "", secType = "", holdingTicker = "", holdingSecID = "", field = "", pandas = "1"):
    """
    获取基金定期披露的持仓明细，包含所持有的股票、债券、基金的持仓明细数据。收录了2005年以来的历史数据，数据更新频率为季度。获取方式支持：1）输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间的基金持仓；2）输入reportDate,不输入其他参数，可以查询到输入日期的全部基金持仓数据。
    
    :param secID: 证券ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、reportDate至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker、reportDate至少选择一个
    :param reportDate: 输入一个报告日期，如20141231，不输入其他请求参数，可获取这个报告期全部基金资产配置，输入格式“YYYYMMDD”,secID、ticker、reportDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param secType: 报告期内基金投资组合中持有证券类型。E-股票，B-债券，F-基金。对应DataAPI.SysCodeGet.codeTypeID=10001。,可以是列表,可空
    :param holdingTicker: 持有证券交易代码,可以是列表,可空
    :param holdingSecID: 持有证券内部编码,可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundHoldings.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        reportDate = reportDate.strftime('%Y%m%d')
    except:
        reportDate = reportDate.replace('-', '')
    requestString.append("&reportDate=%s"%(reportDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secType=")
    if hasattr(secType,'__iter__') and not isinstance(secType, str):
        if len(secType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secType
            requestString.append(None)
        else:
            requestString.append(','.join(secType))
    else:
        requestString.append(secType)
    requestString.append("&holdingTicker=")
    if hasattr(holdingTicker,'__iter__') and not isinstance(holdingTicker, str):
        if len(holdingTicker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = holdingTicker
            requestString.append(None)
        else:
            requestString.append(','.join(holdingTicker))
    else:
        requestString.append(holdingTicker)
    requestString.append("&holdingSecID=")
    if hasattr(holdingSecID,'__iter__') and not isinstance(holdingSecID, str):
        if len(holdingSecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = holdingSecID
            requestString.append(None)
        else:
            requestString.append(','.join(holdingSecID))
    else:
        requestString.append(holdingSecID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundHoldingsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundHoldingsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'SecShortName', u'reportDate', u'holdingsecType', u'holdingSecID', u'holdingTicker', u'holdingExchangeCd', u'holdingsecShortName', u'holdVolume', u'marketValue', u'ratioInNa', u'publishDate', u'currencyCd']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','SecShortName': 'str','holdingsecType': 'str','holdingSecID': 'str','holdingTicker': 'str','holdingExchangeCd': 'str','holdingsecShortName': 'str','currencyCd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundETFPRListGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取ETF基金交易日的申赎清单基本信息，包含标的指数名称，上一交易日的现金差额、最小申赎单位净值、单位净值，交易日当日的预估现金差额、最小申赎单位、现金替代比例上限、是否允许申购赎回、是否公布IOPV等信息。收录了2005年以来的历史数据，数据更新频率为日。不输入日期则默认获取近两天的数据。
    
    :param secID: 证券ID，证券统一编码，可通过交易代码在DataAPI.SecIDGet获取到。,secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",secID、ticker至少选择一个
    :param beginDate: 起始日期，默认值为今天，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，默认值为今天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundETFPRList.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundETFPRListGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundETFPRListGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'fundShortName', u'underLyingIndex', u'idxShortName', u'preTradeDate', u'cashComp', u'NAVPreCu', u'NAV', u'tradeDate', u'estCahComp', u'maxCashRatio', u'creationUnit', u'ifIOPV', u'ifPurchaseble', u'ifRedeemable']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','fundShortName': 'str','underLyingIndex': 'str','idxShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundETFConsGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取ETF基金每个交易日的跟踪的标的指数成分券清单，包含成分券的代码、简称、股票数量、现金替代标志、现金替代溢价比、固定替代金额等信息。收录了2006年以来的历史数据，数据更新频率为日。不输入日期则默认获取近两天的数据。
    
    :param secID: 证券ID，证券统一编码，可通过交易代码在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，默认值为今天，输入格式“YYYYMMDD”,可空
    :param endDate: 交易日期，默认为今天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundETFCons.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundETFConsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundETFConsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'consID', u'consTicker', u'consName', u'consExchangeCD', u'quantity', u'cashSubsSign', u'CashRatio', u'fixedCahsAmount']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','consID': 'str','consTicker': 'str','consName': 'str','consExchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundRatingGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取上海证券基金评级信息。收录了10年以来的历史数据，数据更新频率为月。不输入日期则默认获取近一年以来的历史数据。
    
    :param secID: 证券ID，证券统一编码，可通过交易代码在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，默认为一年前，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，默认为今天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundRating.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundRatingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundRatingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'endDate', u'period', u'overallRating']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundManagerGet(secID = "", ticker = "", personID = "", name = "", field = "", pandas = "1"):
    """
    获取某只基金从成立以来，基金经理与基金经理助理的任职变动情况，包含基金经理的姓名，学历、性别、出生年、证书、入职时间和离职时间等。数据更新频率为不定期。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、personID、name至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker、personID、name至少选择一个
    :param personID: 人员内部编码,可以是列表,secID、ticker、personID、name至少选择一个
    :param name: 姓名,secID、ticker、personID、name至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundManager.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundManagerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundManagerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'exchangeCD', u'publishDate', u'personID', u'name', u'gender', u'birthday', u'ethnicGroup', u'edu', u'eduDesc', u'certificate', u'position', u'isIncumbent', u'accessionDate', u'dimissionDate', u'backgroundDesc']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str','name': 'str','gender': 'str','ethnicGroup': 'str','eduDesc': 'str','certificate': 'str','position': 'str','backgroundDesc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundSharesChgGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取场内基金的份额变动信息，包含基金名称、交易代码、交易市场、截止日期、流通份额等信息。收录了2005年以来的历史数据，数据更新频率为日。
    
    :param secID: 证券ID，证券统一编码，可通过交易代码在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundSharesChg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundSharesChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundSharesChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'endDate', u'circulationShares']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundManagerPerformanceGet(personID = "", category = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金经理的业绩数据，包含基金经理ID、姓名、日期、日回报、最早任职该类型以来的总回报。收录了2004年以来的历史数据，数据更新频率为不定期。
    
    :param personID: 输入多个基金经理ID,可以是列表,可空
    :param category: 输入多种基金类型，E为股票型，H为混合型（注：一个基金经理可能同时管理股票型基金或混合型基金）。对应DataAPI.SysCodeGet.codeTypeID=40002。,可以是列表,可空
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundManagerPerformance.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    requestString.append("&category=")
    if hasattr(category,'__iter__') and not isinstance(category, str):
        if len(category) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = category
            requestString.append(None)
        else:
            requestString.append(','.join(category))
    else:
        requestString.append(category)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundManagerPerformanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundManagerPerformanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'category', u'endDate', u'return_rate_daily', u'return_rate_total']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','category': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundLeverageInfoGet(secID = "", ticker = "", exchangeCDLeverage = "", field = "", pandas = "1"):
    """
    获取分级基金的基本信息，包含母、子基金名称、交易代码、分拆比例、折算等信息。
    
    :param secID: 母基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、exchangeCDLeverage至少选择一个
    :param ticker: 母基金交易代码,支持多值输入。,可以是列表,secID、ticker、exchangeCDLeverage至少选择一个
    :param exchangeCDLeverage: 子基金交易市场,支持多值输入。XSHG-上海证券交易所；XSHE-深圳证券交易所。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,secID、ticker、exchangeCDLeverage至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundLeverageInfo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCDLeverage=")
    if hasattr(exchangeCDLeverage,'__iter__') and not isinstance(exchangeCDLeverage, str):
        if len(exchangeCDLeverage) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCDLeverage
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCDLeverage))
    else:
        requestString.append(exchangeCDLeverage)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundLeverageInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundLeverageInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'fundID', u'category', u'secID', u'ticker', u'exchangeCD', u'secShortName', u'secIDLeverage', u'shareType', u'tickerLeverage', u'exchangeCDLeverage', u'secShortNameLeverage', u'shareProp', u'idxCn', u'estDate', u'endDate', u'regSplitDate', u'upThrshold', u'downThrshold', u'splitNote', u'navLever', u'priceLever', u'maxApply', u'maxRedeem']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'category': 'str','secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','secIDLeverage': 'str','shareType': 'str','tickerLeverage': 'str','exchangeCDLeverage': 'str','secShortNameLeverage': 'str','idxCn': 'str','splitNote': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundLeverRateGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取分级基金A份额每期约定收益及预期约定收益，约定收益表达式。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"，"000001,000003",可以是列表,secID、ticker至少选择一个
    :param beginDate: 开始日期,可空
    :param endDate: 截止日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundLeverRate.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundLeverRateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundLeverRateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'beginDate', u'endDate', u'returnRateA', u'note']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','note': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundBondTypeGet(secID = "", ticker = "", beginDate = "", endDate = "", bondTypeCD = "", field = "", pandas = "1"):
    """
    获取基金的券种信息，包含基金债券组合结构信息，包含债券类型、对应市值、占资产净值比例等
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、beginDate、endDate、bondTypeCD至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate、bondTypeCD至少选择一个
    :param beginDate: 报告开始日期,secID、ticker、beginDate、endDate、bondTypeCD至少选择一个
    :param endDate: 报告截止日期,secID、ticker、beginDate、endDate、bondTypeCD至少选择一个
    :param bondTypeCD: 债券类别代码,可以是列表,secID、ticker、beginDate、endDate、bondTypeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundBondType.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&bondTypeCD=")
    if hasattr(bondTypeCD,'__iter__') and not isinstance(bondTypeCD, str):
        if len(bondTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = bondTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(bondTypeCD))
    else:
        requestString.append(bondTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundBondTypeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundBondTypeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'pubDate', u'reportDate', u'bondTypeCD', u'bondType', u'value', u'valueInNA', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','bondTypeCD': 'str','bondType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundPerfIndicGet(dataDate = "", secID = "", ticker = "", window = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取公募基金净值性能指标，包含收益和风险类别指标，如年化收益、年化风险、夏普比率、最大回撤、信息比率等157个指标，8个时间维度的数据（不包含货币基金）。
    
    :param dataDate: 输入一个日期，不输入其他请求参数，可获取到一天全部基金净值数据，输入格式“YYYYMMDD”,dataDate、secID、ticker、window至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,dataDate、secID、ticker、window至少选择一个
    :param ticker: 输入一个或多个基金代码，用\",可以是列表,dataDate、secID、ticker、window至少选择一个
    :param window: 性能指标计算时间窗口长度,1-近一个月;2-近三个月;3-近半年;4-年初至今;5-近一年;6-近两年;7-近三年;8-成立以来;,可以是列表,dataDate、secID、ticker、window至少选择一个
    :param beginDate: 起始净值日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止净值日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundPerfIndic.csv?ispandas=1&') 
    try:
        dataDate = dataDate.strftime('%Y%m%d')
    except:
        dataDate = dataDate.replace('-', '')
    requestString.append("dataDate=%s"%(dataDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&window=")
    if hasattr(window,'__iter__') and not isinstance(window, str):
        if len(window) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = window
            requestString.append(None)
        else:
            requestString.append(','.join(window))
    else:
        requestString.append(window)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundPerfIndicGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundPerfIndicGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'window', u'endDate', u'annTotReturn', u'annTotRisk', u'annActReturn', u'annActRisk', u'deannActReturn', u'deannActRisk', u'maxDD', u'downSideRisk', u'IR', u'sharpeRatio', u'maxDDRecDays', u'corrEquity', u'corrBond', u'corrFuture', u'maxContRiseDays', u'maxContDeclDays', u'maxContRiseRate', u'maxContDeclRate', u'maxDRisingRate', u'maxDDeclineRate', u'maxRiseBegDate', u'maxRiseEndDate', u'maxDeclBegDate', u'maxDeclEndDate', u'lossDaysRate', u'profitDaysRate', u'HURST', u'STUTZER', u'TREYNOR', u'SORTINO', u'realizedAlpha', u'realizedBeta', u'residualRisk', u'mSquare', u'adjSharpRatio', u'var950', u'erVar950', u'cvar950', u'csr950', u'var975', u'erVar975', u'cvar975', u'csr975', u'var990', u'erVar990', u'cvar990', u'csr990', u'SKEWNESS', u'KURTOSIS', u'JENSENS', u'CALMAR', u'STEARLING', u'BURKE', u'OMEGA', u'KAPPA3', u'MAR', u'RAR', u'rCubed', u'trackingError', u'rSquare', u'upCaptReturn', u'upCaptRate', u'downCaptReturn', u'downCaptRate', u'secMDD', u'secMDDPeriods', u'secMDDRecovery', u'thirdMDD', u'thirdMDDPeriods', u'thirdMDDRecovery', u'weekAutoCorr', u'bullBeta', u'bearBeta', u'timingTM', u'selectionTM', u'timingCL', u'selectionCL', u'timingHM', u'selectionHM', u'alphaCoef', u'isNavQualified', u'dMaxDDRecPeriods', u'dMaxContRiseRate', u'dMaxContRisePeriods', u'dMaxPeriodRiseRate', u'dMaxRiseBegDate', u'dMaxRiseEndDate', u'dMaxContDeclRate', u'dMaxContDeclPeriods', u'dMaxPeriodDeclRate', u'dMaxDeclBegDate', u'dMaxDeclEndDate', u'dProfPeriodRate', u'dLossPeriodRate', u'wMaxDdRecPeriods', u'wMaxContRiseRate', u'wMaxContRisePeriods', u'wMaxPeriodRiseRate', u'wMaxRiseBegDate', u'wMaxRiseEndDate', u'wMaxContDeclRate', u'wMaxContDeclPeriods', u'wMaxPeriodDeclRate', u'wMaxDeclBegDate', u'wMaxDeclEndDate', u'wProfPeriodRate', u'wLossPeriodRate', u'mMaxDDRecPeriods', u'mMaxContRiseRate', u'mMaxContRisePeriods', u'mMaxPeriodRiseRate', u'mMaxRiseBegDate', u'mMaxRiseEndDate', u'mMaxContDeclRate', u'mMaxContDeclPeriods', u'mMaxPeriodDeclRate', u'mMaxDeclBegDate', u'mMaxDeclEndDate', u'mProfPeriodRate', u'mLossPeriodRate', u'qMaxDDRecPeriods', u'qMaxContRiseRate', u'qMaxContRisePeriods', u'qMaxPeriodRiseRate', u'qMaxRiseBegDate', u'qMaxRiseEndDate', u'qMaxContDeclRate', u'qMaxContDeclPeriods', u'qMaxPeriodDeclRate', u'qMaxDeclBegDate', u'qMaxDeclEndDate', u'qProfPeriodRate', u'qLossPeriodRate', u'sMaxDDRecPeriods', u'sMaxPeriodRiseRate', u'sMaxContRisePeriods', u'sMaxContRiseRate', u'sMaxRiseBegDate', u'sMaxRiseEndDate', u'sMaxPeriodDeclRate', u'sMaxContDeclPeriods', u'sMaxContDeclRate', u'sMaxDeclBegDate', u'sMaxDeclEndDate', u'sProfPeriodRate', u'sLossPeriodRate', u'yMaxDDRecPeriods', u'yMaxPeriodRiseRate', u'yMaxContRisePeriods', u'yMaxContRiseRate', u'yMaxRiseBegDate', u'yMaxRiseEndDate', u'yMaxPeriodDeclRate', u'yMaxContDeclPeriods', u'yMaxContDeclRate', u'yProfPeriodRate', u'yLosyPeriodRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundEquTradeGet(reportDate = "", secID = "", ticker = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取基金基金在年报、半年报中披露的内股票买卖金额信息。收录了2004年以来的历史数据，数据更新频率为半年度。获取方式支持：1）输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间的股票买卖情况；2）输入reportDate，不输入其他参数，可以查询到输入日期的全部基金的股票买卖数据。
    
    :param reportDate: 报告日期,reportDate、secID、ticker至少选择一个
    :param secID: 证券ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,reportDate、secID、ticker至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,reportDate、secID、ticker至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param reportTypeCD: 报告类型代码，年报/半年报,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundEquTrade.csv?ispandas=1&') 
    try:
        reportDate = reportDate.strftime('%Y%m%d')
    except:
        reportDate = reportDate.replace('-', '')
    requestString.append("reportDate=%s"%(reportDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundEquTradeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundEquTradeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'reportTypeCD', u'reportType', u'publishDate', u'reportDate', u'buyCost', u'sellIncome', u'balance']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundEquChgGet(ticker = "", secID = "", equitySecID = "", beginDate = "", endDate = "", changeTypeCD = "", field = "", pandas = "1"):
    """
    获取基金基金在年报、半年报中披露的累计买入、卖出金额超出期末基金资产净值2％或前20名的股票明细。收录了2008年以来的历史数据，数据更新频率为半年度。获取方式支持：1）输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，在一段时间内股票投资组合变动情况；2）输入equitySecID,并输入beginDate和endDate，可以查询到指定报告期内该只股票被全部基金买卖的数据。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID、equitySecID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID、equitySecID至少选择一个
    :param equitySecID: 买卖证券ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID、equitySecID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param changeTypeCD: 1-买入；2-卖出,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundEquChg.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&equitySecID=")
    if hasattr(equitySecID,'__iter__') and not isinstance(equitySecID, str):
        if len(equitySecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = equitySecID
            requestString.append(None)
        else:
            requestString.append(','.join(equitySecID))
    else:
        requestString.append(equitySecID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(changeTypeCD, str) and not isinstance(changeTypeCD, unicode):
        changeTypeCD = str(changeTypeCD)

    requestString.append("&changeTypeCD=%s"%(changeTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundEquChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundEquChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'reportDate', u'actualReportDate', u'changeTypeCD', u'changeType', u'equityTicker', u'equityShortName', u'equityExchangeCD', u'equitySecID', u'serialNO', u'marketValue', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','changeType': 'str','equityTicker': 'str','equityShortName': 'str','equityExchangeCD': 'str','equitySecID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundRestrictSecGet(ticker = "", secID = "", reportTypeCD = "", beginDate = "", endDate = "", restrictTypeCD = "", field = "", pandas = "1"):
    """
    获取基金在年报、半年报中由于配售等原因持有的流通受限证券情况。收录了2008年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间的流通受限制证券情况
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param reportTypeCD: 报告类型，年报/半年报,可空
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param restrictTypeCD: 流通受限制原因：1-认购新发/增发证券；2-上市公司停牌期；3-正回购交易抵押,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundRestrictSec.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(restrictTypeCD, str) and not isinstance(restrictTypeCD, unicode):
        restrictTypeCD = str(restrictTypeCD)

    requestString.append("&restrictTypeCD=%s"%(restrictTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundRestrictSecGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundRestrictSecGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'reportTypeCD', u'reportDate', u'endDate', u'restrictTypeCD', u'securityTypeCD', u'securityType', u'equitySecID', u'equityTicker', u'equityExchangeCD', u'equityShortName', u'subDate', u'cirDate', u'subPrice', u'valUnit', u'suspendDate', u'reOpenPrice', u'holdVolume', u'buyCost', u'marketValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','reportTypeCD': 'str','reportDate': 'str','endDate': 'str','securityTypeCD': 'str','securityType': 'str','equitySecID': 'str','equityTicker': 'str','equityExchangeCD': 'str','equityShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundNavDeviGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金在季报中披露的资产净值偏离程度。收录了2009年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，在一段时间内确定的基金资产净值的偏离。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundNavDevi.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundNavDeviGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundNavDeviGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secID', u'secShortName', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'countAbsDevi', u'maxDevi', u'minDevi', u'avgAbsDevi']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secID': 'str','secShortName': 'str','reportTypeCD': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundQdiiAreaGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取QDII基金在定期报告中披露的期末在各个国家（地区）证券市场的权益投资分布。收录了2007年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，在一段时间内所持权益投资在各国家/地区的分布情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundQdiiArea.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundQdiiAreaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundQdiiAreaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secID', u'secShortName', u'publishDate', u'reportDate', u'areaCode', u'areaName', u'marketValue', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secID': 'str','secShortName': 'str','areaCode': 'str','areaName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundBondCredRatingGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取QDII基金基金在定期报告中披露的所投债券的债券信用等级分类的投资组合情况。收录了2009年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，在一段时间内所持债券的信用等级分类的债券投资组合情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundBondCredRating.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundBondCredRatingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundBondCredRatingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'bondRating', u'marketValue', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','reportTypeCD': 'str','reportType': 'str','bondRating': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundHolderInfoGet(ticker = "", secID = "", beginDate = "", endDate = "", infoSourceCD = "", field = "", pandas = "1"):
    """
    获取本基金在年报、半年报中披露的持有人结构信息。收录了2004年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间的持有人结构信息情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,可空
    :param infoSourceCD: 信息来源代码:A-年报；S1-中报；LIST-上市公告书。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundHolderInfo.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(infoSourceCD, str) and not isinstance(infoSourceCD, unicode):
        infoSourceCD = str(infoSourceCD)

    requestString.append("&infoSourceCD=%s"%(infoSourceCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundHolderInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundHolderInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'infoSourceCD', u'infoSource', u'publishDate', u'reportDate', u'holderNumber', u'avgHoldShares', u'instHoldShares', u'instHoldRatio', u'indiHoldShares', u'indiHoldRatio', u'undefinedHoldShares', u'undefinedHoldRatio', u'top10HoldShares', u'top10HoldRatio', u'pracHoldShares', u'pracHoldRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','infoSourceCD': 'str','infoSource': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundMainHolderGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取本基金在年报、半年报中披露的前十名持有人持有基金份额情况。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间前十名持有人持有基金份额情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundMainHolder.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundMainHolderGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundMainHolderGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'endDate', u'reportDate', u'serialNO', u'holderName', u'partyID', u'partyName', u'holdShares', u'holdRatio']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','holderName': 'str','partyID': 'str','partyName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundSingleHolderGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取本基金在季报中披露的单一持有人份额超过20%的信息。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段时间单一持有人持有基金份额比例超过20%的相关信息。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundSingleHolder.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundSingleHolderGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundSingleHolderGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'final_holdShares', u'final_holdRatio', u'ticker', u'secShortName', u'secID', u'exchangeCD', u'publishDate', u'reportDate', u'holderType', u'serialNo', u'influenceInterval', u'start_holdShares', u'applyShares', u'redeemShares']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','holderType': 'str','influenceInterval': 'str','start_holdShares': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundBsGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", itemCD = "", isNew = "", field = "", pandas = "1"):
    """
    获取本基金在半年报/年报中依据2007年新会计准则披露的基金资产负债表。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段报告期内的资产负债情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,可空
    :param reportTypeCD: 报告类型:0105-中报;0106-年报,可空
    :param itemCD: 会计科目代码，对应DataAPI.SysCodeGet.codeTypeID=40078。,可以是列表,可空
    :param isNew: 是否当期:1-本期;0-上期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundBs.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&itemCD=")
    if hasattr(itemCD,'__iter__') and not isinstance(itemCD, str):
        if len(itemCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemCD
            requestString.append(None)
        else:
            requestString.append(','.join(itemCD))
    else:
        requestString.append(itemCD)
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundBsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundBsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'publishDate', u'reportTypeCD', u'reportType', u'endDateRep', u'endDate', u'isNew', u'itemCD', u'item', u'value']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','itemCD': 'str','item': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundIsGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", itemCD = "", isNew = "", field = "", pandas = "1"):
    """
    获取本基金在半年报/年报中依据2007年新会计准则披露的基金利润表。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段报告期内的利润情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,可空
    :param reportTypeCD: 报告类型:0105-中报;0106-年报,可空
    :param itemCD: 会计科目代码，对应DataAPI.SysCodeGet.codeTypeID=40079。,可以是列表,可空
    :param isNew: 是否当期:1-本期;0-上期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundIs.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&itemCD=")
    if hasattr(itemCD,'__iter__') and not isinstance(itemCD, str):
        if len(itemCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemCD
            requestString.append(None)
        else:
            requestString.append(','.join(itemCD))
    else:
        requestString.append(itemCD)
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundIsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundIsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'publishDate', u'endDateRep', u'startDate', u'endDate', u'isNew', u'itemCD', u'item', u'itemValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','itemCD': 'str','item': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundMainIndiGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", itemCD = "", isNew = "", field = "", pandas = "1"):
    """
    获取本基金在半年报/年报中披露的基金主要财务指标。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段报告期内的财务指标情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,可空
    :param reportTypeCD: 报告类型:0105-中报;0106-年报,可空
    :param itemCD: 会计科目代码，对应DataAPI.SysCodeGet.codeTypeID=40086。,可以是列表,可空
    :param isNew: 是否当期:1-本期;0-上期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundMainIndi.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&itemCD=")
    if hasattr(itemCD,'__iter__') and not isinstance(itemCD, str):
        if len(itemCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemCD
            requestString.append(None)
        else:
            requestString.append(','.join(itemCD))
    else:
        requestString.append(itemCD)
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundMainIndiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundMainIndiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'publishDate', u'endDateRep', u'startDate', u'endDate', u'isNew', u'itemCD', u'item', u'itemValue', u'unit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','itemCD': 'str','item': 'str','unit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundMainIndiQGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", itemCD = "", field = "", pandas = "1"):
    """
    获取本基金在季报中披露的基金主要财务指标。收录了2009年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，一段报告期内的财务指标情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,可空
    :param reportTypeCD: 报告类型:0105-中报;0106-年报,可空
    :param itemCD: 会计科目代码，对应DataAPI.SysCodeGet.codeTypeID=40086。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundMainIndiQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&itemCD=")
    if hasattr(itemCD,'__iter__') and not isinstance(itemCD, str):
        if len(itemCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = itemCD
            requestString.append(None)
        else:
            requestString.append(','.join(itemCD))
    else:
        requestString.append(itemCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundMainIndiQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundMainIndiQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'publishDate', u'reportDate', u'startDate', u'endDate', u'itemCD', u'item', u'itemValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','itemCD': 'str','item': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundFeeGet(secID = "", ticker = "", isEXE = "", chargeTypeCD = "", field = "", pandas = "1"):
    """
    获取基金费率，如管理费、销售费、认购费、申购费、赎回费等。
    
    :param secID: 证券内部ID,可以是列表,secID、ticker至少选择一个
    :param ticker: 基金代码,可以是列表,secID、ticker至少选择一个
    :param isEXE: 是否执行,可空
    :param chargeTypeCD: 费率大类代码。对应DataAPI.SysCodeGet.codeTypeID=40076&useType=VALUE_NUM_CD,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundFee.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(isEXE, str) and not isinstance(isEXE, unicode):
        isEXE = str(isEXE)

    requestString.append("&isEXE=%s"%(isEXE))
    requestString.append("&chargeTypeCD=")
    if hasattr(chargeTypeCD,'__iter__') and not isinstance(chargeTypeCD, str):
        if len(chargeTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = chargeTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(chargeTypeCD))
    else:
        requestString.append(chargeTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundFeeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundFeeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'ticker', u'secShortName', u'publishDate', u'isExe', u'beginDate', u'endDate', u'chargeTypeCD', u'chargeType', u'chargeExchCD', u'chargeExch', u'chargeModeCD', u'chargeMode', u'chargePCD', u'chargeP', u'clientTypeCD', u'clientType', u'minCharRate', u'maxCharRate', u'chargeUnit', u'chargeDesc', u'charCon1', u'charConCn1', u'charConNo1', u'charConUnit1', u'charStart1', u'charEnd1', u'isCharStart1', u'isCharEnd1', u'charCon2', u'charConCn2', u'charConNo2', u'charConUnit2', u'charStart2', u'charEnd2', u'isCharStart2', u'isCharEnd2', u'notes']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','ticker': 'str','secShortName': 'str','chargeTypeCD': 'str','chargeType': 'str','chargeExchCD': 'str','chargeExch': 'str','chargeModeCD': 'str','chargeMode': 'str','chargePCD': 'str','chargeP': 'str','clientTypeCD': 'str','clientType': 'str','chargeUnit': 'str','chargeDesc': 'str','charCon1': 'str','charConCn1': 'str','charConUnit1': 'str','charCon2': 'str','charConCn2': 'str','charConUnit2': 'str','notes': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundPurRedGet(secID = "", ticker = "", chgTypeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金申购、赎回状态
    
    :param secID: 证券内部ID,可以是列表,secID、ticker、chgTypeCD至少选择一个
    :param ticker: 基金代码,可以是列表,secID、ticker、chgTypeCD至少选择一个
    :param chgTypeCD: 变动类型代码,可以是列表,secID、ticker、chgTypeCD至少选择一个
    :param beginDate: 变动开始日期,可空
    :param endDate: 变动结束日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundPurRed.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&chgTypeCD=")
    if hasattr(chgTypeCD,'__iter__') and not isinstance(chgTypeCD, str):
        if len(chgTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = chgTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(chgTypeCD))
    else:
        requestString.append(chgTypeCD)
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundPurRedGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundPurRedGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'chgDate', u'chgTypeCD', u'chgType', u'applyTop']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','chgType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundSplitGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取本基金在分红公告中披露的基金拆分折算情况。收录了2005年以来的历史数据，数据不定期更新。获取方式支持：输入一个或多个secID/ticker，可以查询到指定基金的历史拆分折算情况；或者输入beginDate和endDate，获取指定时间段内基金拆分折算情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundSplit.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundSplitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundSplitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'planIssueDate', u'outIssueDate', u'typeCD', u'type', u'splitTypeCD', u'splitType', u'splitDate', u'actualSplitDate', u'splitRatio', u'shareBefore', u'shareAfter']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','type': 'str','splitType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundRelGet(ticker = "", secID = "", relTypeCD = "", relTicker = "", relSecID = "", field = "", pandas = "1"):
    """
    获取基金代码关联信息，包含母子基金分级关联、同一基金分级关联、联接基金关联等。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param relTypeCD: 代码关联类型，如：0301-母子基金分级关联，0302-同一基金分级关联,可空
    :param relTicker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,可空
    :param relSecID: 关联基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundRel.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(relTypeCD, str) and not isinstance(relTypeCD, unicode):
        relTypeCD = str(relTypeCD)

    requestString.append("&relTypeCD=%s"%(relTypeCD))
    requestString.append("&relTicker=")
    if hasattr(relTicker,'__iter__') and not isinstance(relTicker, str):
        if len(relTicker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = relTicker
            requestString.append(None)
        else:
            requestString.append(','.join(relTicker))
    else:
        requestString.append(relTicker)
    requestString.append("&relSecID=")
    if hasattr(relSecID,'__iter__') and not isinstance(relSecID, str):
        if len(relSecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = relSecID
            requestString.append(None)
        else:
            requestString.append(','.join(relSecID))
    else:
        requestString.append(relSecID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundRelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundRelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'relTypeCD', u'relType', u'relSecID', u'relTicker', u'relSecShortName', u'relExchangeCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','relTypeCD': 'str','relType': 'str','relSecID': 'str','relTicker': 'str','relSecShortName': 'str','relExchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundNavGrGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    基金净值增长，包含近1个月，近3个月，近6个月，近1年，近3年等多维度的收益情况。收录了1998年以来的历史数据，数据更新频率为日度。获取方式支持：输入基金代码,并输入beginDate和endDate，可以查询到指定基金的多维度收益情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundNavGr.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundNavGrGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundNavGrGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secID', u'secShortName', u'exchangeCD', u'endDate', u'returnRate', u'returnRateWtd', u'returnRate1W', u'returnRateMtd', u'returnRate1M', u'returnRate3M', u'returnRate6M', u'returnRateYtd', u'returnRate1Y', u'returnRate2Y', u'returnRate3Y', u'returnRate5Y', u'returnRateEst', u'isYear']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secID': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundNavGrRkGet(ticker = "", secID = "", beginDate = "", endDate = "", rankCategory = "", field = "", pandas = "1"):
    """
    基金净值增长排名，包含近1个月，近3个月，近6个月，近1年，近3年等多维度的收益排名情况。收录了2004年以来的历史数据，数据更新频率为日度。获取方式支持：输入基金代码,并输入beginDate和endDate，可以查询到指定基金的多维度收益不同分类规则下的排名情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param rankCategory: 指不同的基金分类规则,40067-通联分类(投资类型维度),可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundNavGrRk.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(rankCategory, str) and not isinstance(rankCategory, unicode):
        rankCategory = str(rankCategory)

    requestString.append("&rankCategory=%s"%(rankCategory))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundNavGrRkGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundNavGrRkGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secID', u'secShortName', u'exchangeCD', u'endDate', u'rankCategory', u'rankType', u'rankReturnRate', u'rankReturnRateWtd', u'rankReturnRate1W', u'rankReturnRateMtd', u'rankReturnRate1M', u'rankReturnRate3M', u'rankReturnRate6M', u'rankReturnRateYtd', u'rankReturnRate1Y', u'rankReturnRate2Y', u'rankReturnRate3Y', u'rankReturnRate5Y', u'rankReturnRateEst']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secID': 'str','secShortName': 'str','exchangeCD': 'str','rankCategory': 'str','rankType': 'str','rankReturnRate': 'str','rankReturnRateWtd': 'str','rankReturnRate1W': 'str','rankReturnRateMtd': 'str','rankReturnRate1M': 'str','rankReturnRate3M': 'str','rankReturnRate6M': 'str','rankReturnRateYtd': 'str','rankReturnRate1Y': 'str','rankReturnRate2Y': 'str','rankReturnRate3Y': 'str','rankReturnRate5Y': 'str','rankReturnRateEst': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundMperfGet(ticker = "", secID = "", beginDate = "", endDate = "", windowCD = "", field = "", pandas = "1"):
    """
    记录货币基金每万份收益均值/方差、7日年化收益率均值/方差的情况。收录了2004年以来的历史数据，数据更新频率为日度。获取方式支持：输入基金代码,并输入beginDate和endDate，可以查询到指定货币基金多维度下的每万份收益均值/方差、7日年化收益率均值/方差的情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param windowCD: 区间范围计算维度，1-近一个月，2-近三个月，3-近半年，4-年初至今,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundMperf.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(windowCD, str) and not isinstance(windowCD, unicode):
        windowCD = str(windowCD)

    requestString.append("&windowCD=%s"%(windowCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundMperfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundMperfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secID', u'secShortName', u'exchangeCD', u'endDate', u'windowCD', u'window', u'avgDailyProfit', u'varDailyProfit', u'avgWeeklyYield', u'varWeeklyYield']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secID': 'str','secShortName': 'str','exchangeCD': 'str','window': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundManagerInfoGet(personID = "", name = "", genderCD = "", field = "", pandas = "1"):
    """
    获取基金经理基本信息,包含公募与私募基金经理的人物名字、性别、最高学历、从业经历等。数据更新频率为不定期。获取方式支持：输入基金经理姓名,可以查询到指定基金经理的基本信息。
    
    :param personID: 人员编码，基金经理编码可通过name在getFundManager获取到。,可以是列表,personID、name至少选择一个
    :param name: 基金经理姓名,可以是列表,personID、name至少选择一个
    :param genderCD: 性别代码：F-女，M-男,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundManagerInfo.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    requestString.append("&name=")
    if hasattr(name,'__iter__') and not isinstance(name, str):
        if len(name) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = name
            requestString.append(None)
        else:
            requestString.append(','.join(name))
    else:
        requestString.append(name)
    requestString.append("&genderCD=")
    if hasattr(genderCD,'__iter__') and not isinstance(genderCD, str):
        if len(genderCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = genderCD
            requestString.append(None)
        else:
            requestString.append(','.join(genderCD))
    else:
        requestString.append(genderCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundManagerInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundManagerInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'genderCD', u'gender', u'birthday', u'nationalityCD', u'nationality', u'certificate', u'photo', u'educationCD', u'education', u'gradUniv', u'major', u'practiceDate', u'mfpfCD', u'mfToPf', u'bigIssue', u'backgroundDesc', u'awards', u'gradUniv2', u'major2', u'postGradUniv1', u'postGradMajor1', u'postGradUniv2', u'postGradMajor2', u'drGradUniv1', u'drGradMajor1', u'drGradUniv2', u'drGradMajor2']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','genderCD': 'str','gender': 'str','birthday': 'str','nationalityCD': 'str','nationality': 'str','certificate': 'str','photo': 'str','education': 'str','gradUniv': 'str','major': 'str','practiceDate': 'str','mfToPf': 'str','bigIssue': 'str','backgroundDesc': 'str','awards': 'str','gradUniv2': 'str','major2': 'str','postGradUniv1': 'str','postGradMajor1': 'str','postGradUniv2': 'str','postGradMajor2': 'str','drGradUniv1': 'str','drGradMajor1': 'str','drGradUniv2': 'str','drGradMajor2': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundRemainMatGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取基金在定期报告中披露的投资组合的剩余期限基本情况。收录了2009年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定基金在定期报告中披露的投资组合的剩余期限基本情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param reportTypeCD: 报告类型代码，0101-一季报，0102-二季报，0103-三季报，0104-四季报,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundRemainMat.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundRemainMatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundRemainMatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'avgRemMat', u'maxRemMat', u'minRemMat']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundShareChangeGet(secID = "", ticker = "", reportTypeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金定期报告中开放式基金份额变动情况。
    
    :param secID: 证券内部编码,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param reportTypeCD: 报告类型。对应DataAPI.SysCodeGet.codeTypeID=40012。,可以是列表,可空
    :param beginDate: 报告期开始时间,可空
    :param endDate: 报告期截止时间,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundShareChange.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&reportTypeCD=")
    if hasattr(reportTypeCD,'__iter__') and not isinstance(reportTypeCD, str):
        if len(reportTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(reportTypeCD))
    else:
        requestString.append(reportTypeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundShareChangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundShareChangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'ticker', u'secShortName', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'startShare', u'applyShare', u'redeemShare', u'splitShare', u'endShare']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','ticker': 'str','secShortName': 'str','reportTypeCD': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundNvChangeGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取记录基金在年报、半年报中依据2007年新会计准则披露的基金净值变动情况。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定基金在定期报告中披露的基金净值变动情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param reportTypeCD: 报告类型代码，0105-半年报，0106-年报,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundNvChange.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundNvChangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundNvChangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'exchangeCD', u'secShortName', u'secID', u'reportTypeCD', u'reportType', u'publishDate', u'reportDate', u'startDate', u'endDate', u'isReport', u'isNew', u'itemCD', u'item', u'itemValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','secShortName': 'str','secID': 'str','reportTypeCD': 'str','reportType': 'str','isReport': 'str','itemCD': 'str','item': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundIssueGet(ticker = "", secID = "", fundTypeCD = "", field = "", pandas = "1"):
    """
    记录基金发行情况及上市情况。获取方式支持：输入一个或多个secID/ticker，可以查询到指定基金的发行上市情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param fundTypeCD: 发行基金类型：E-股票型，H-混合型，B-债券型，M-货币型，QDII- QDII, O-其他。对应DataAPI.SysCodeGet.codeTypeID=40015。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundIssue.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(fundTypeCD, str) and not isinstance(fundTypeCD, unicode):
        fundTypeCD = str(fundTypeCD)

    requestString.append("&fundTypeCD=%s"%(fundTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundIssueGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundIssueGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'initPubDate', u'prosIssDate', u'listPubDate', u'raiseMethodCD', u'raiseMethod', u'fundTypeCD', u'fundType', u'issObj', u'issStartDate', u'issEndDate', u'parVal', u'unitIssPrice', u'unitIssFee', u'totalShare', u'vSubShare', u'intSHARE', u'initSubVol', u'initHoldFloatShr', u'initHoldTerm', u'minHoldRatio', u'appAbbrName', u'appCode', u'appUnit', u'vAppAcctsTotal', u'vAppVolTotal', u'overSubMult', u'establishDate', u'appOpenDate', u'redOpenDate', u'currCD', u'currency', u'currTypeCD', u'currTYPE', u'issStateCD', u'issSTATE', u'calIssDate', u'listDATE', u'listPlace', u'floatShares']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','raiseMethodCD': 'str','raiseMethod': 'str','fundTypeCD': 'str','fundType': 'str','issObj': 'str','appAbbrName': 'str','appCode': 'str','currCD': 'str','currency': 'str','currTypeCD': 'str','currTYPE': 'str','issStateCD': 'str','issSTATE': 'str','listPlace': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundTradeSeatGet(ticker = "", secID = "", beginDate = "", endDate = "", partyID = "", field = "", pandas = "1"):
    """
    获取基金在年报、半年报中披露的基金租用证券公司交易单元进行证券投资及佣金支付情况。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定基金，在一段时间内的租用证券公司交易单元进行正确投资及佣金支付情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param partyID: 券商代码，可通过机构名称在DataAPI.PartyIDGet获取到。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundTradeSeat.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(partyID, str) and not isinstance(partyID, unicode):
        partyID = str(partyID)

    requestString.append("&partyID=%s"%(partyID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundTradeSeatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundTradeSeatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'reportDate', u'endDate', u'partyID', u'partyShortName', u'tradUnit', u'equTradeValue', u'equRatioInTotal', u'bondTradeValue', u'bondRatioInTotal', u'repoTradeValue', u'repoRatioInTotal', u'fundTradeValue', u'fundRatioInTotal', u'warrTradeValue', u'warrRatioInTotal', u'commision', u'commInTotal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','partyShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundMCredRatingGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取货币基金基金在年报、半年报中披露的债券信用评级，分短期和长期。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定货币基金，在一段时间内的债券信用评级情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param reportTypeCD: 报告类型代码，0101-一季报，0102-二季报，0103-三季报，0104-四季报,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundMCredRating.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundMCredRatingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundMCredRatingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'isNew', u'ratingTypeCD', u'ratingType', u'bondRatingCD', u'bondRating', u'marketValue', u'currencyCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','reportTypeCD': 'str','reportType': 'str','ratingTypeCD': 'str','ratingType': 'str','bondRatingCD': 'str','bondRating': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundNavPerf2Get(ticker = "", secID = "", beginDate = "", endDate = "", rankCategory = "", field = "", pandas = "1"):
    """
    获取基金相关业绩指标。收录了1998年以来的历史数据，数据更新频率为日度。获取方式支持：输入基金代码，起始、截至日期，可以查询到指定基金一段时间内的业绩指标情况。
    
    :param ticker: 基金交易代码,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param secID: 基金ID,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param rankCategory: 根据不同的分类准则对基金分类，40067-通联分类（根据投资类型）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundNavPerf2.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(rankCategory, str) and not isinstance(rankCategory, unicode):
        rankCategory = str(rankCategory)

    requestString.append("&rankCategory=%s"%(rankCategory))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundNavPerf2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundNavPerf2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'endDate', u'rankCategory', u'maxDrawdown1M', u'maxDrawdown3M', u'maxDrawdown6M', u'maxDrawdown1Y', u'maxDrawdown2Y', u'maxDrawdown3Y', u'maxDrawdown5Y', u'maxDrawdownYtd', u'maxDrawdownEst', u'sharpeRatio1M', u'sharpeRatio3M', u'sharpeRatio6M', u'sharpeRatio1Y', u'sharpeRatio2Y', u'sharpeRatio3Y', u'sharpeRatio5Y', u'sharpeRatioYtd', u'sharpeRatioEst', u'beta1M', u'beta3M', u'beta6M', u'beta1Y', u'beta2Y', u'beta3Y', u'beta5Y', u'betaYtd', u'betaEst', u'alpha1M', u'alpha3M', u'alpha6M', u'alpha1Y', u'alpha2Y', u'alpha3Y', u'alpha5Y', u'alphaYtd', u'alphaEst', u'stdDev1M', u'stdDev3M', u'stdDev6M', u'stdDev1Y', u'stdDev2Y', u'stdDev3Y', u'stdDev5Y', u'stdDevEst', u'stdDevYtd', u'volatility1M', u'volatility3M', u'volatility6M', u'volatility1Y', u'volatility2Y', u'volatility3Y', u'volatility5Y', u'volatilityEst', u'volatilityYtd']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','rankCategory': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundBondRepoRemainGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取货币基金在定期报告中披露的融资情况，包括期内和期末回购融资余额及其占基金资产净值的比例。收录了2009年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定货币基金，在一段时间内的回购融资情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param reportTypeCD: 报告类型代码，0101-一季报，0102-二季报，0103-三季报，0104-四季报,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundBondRepoRemain.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundBondRepoRemainGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundBondRepoRemainGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'inBonRepo', u'inOutrRepo', u'bonRepo', u'outrRepo', u'inBonRepoPct', u'inOutrRepoPct', u'bonRepoPct', u'outrRepoPct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundMatPropGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取基金在定期报告中披露的投资组合的剩余期限分布比例。收录了2009年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定基金在定期报告中披露的投资组合的剩余期限分布比例。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param reportTypeCD: 报告类型代码，0101-一季报，0102-二季报，0103-三季报，0104-四季报,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundMatProp.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundMatPropGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundMatPropGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'matTypeCD', u'matType', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','matTypeCD': 'str','matType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundConvBondGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取基金在定期报告中披露的期末持有的处于转股期的可转换债券明细。收录了2009年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定基金在定期报告中披露的期末持有的处于转股期的可转换债券明细数据。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param reportTypeCD: 报告类型代码，0101-一季报，0102-二季报，0103-三季报，0104-四季报,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundConvBond.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundConvBondGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundConvBondGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'cBondTicker', u'cBondShortName', u'cBondID', u'cBondExchangeCD', u'serialNo', u'marketValue', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','cBondTicker': 'str','cBondShortName': 'str','cBondID': 'str','cBondExchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundInvestIndustryGet(ticker = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取记录基金在季报中基金在定期报告中披露的行业配置信息。收录了1998年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定基金在定期报告中披露的行业配置情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundInvestIndustry.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundInvestIndustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundInvestIndustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'exchangeCD', u'secShortName', u'secID', u'publishDate', u'reportDate', u'investTypeCD', u'investType', u'induCodePub', u'induStd', u'industryStandard', u'industryCode', u'industryName', u'marketValue', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','secShortName': 'str','secID': 'str','investTypeCD': 'str','investType': 'str','induCodePub': 'str','induStd': 'str','industryStandard': 'str','industryCode': 'str','industryName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundTypeAvgGet(dimension = "", objectID = "", category = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取不同分类规则下，基金市场/基金公司各基金类别的平均收益情况。包含近1个月，近3个月，近6个月，近1年，近3年等多维度的收益情况。收录了1998年以来的历史数据，数据更新频率为日度。获取方式支持：输入计算维度，分类规则，分类代码，并输入beginDate和endDate，可以查询到指定维度指定类型的收益情况。
    
    :param dimension: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,dimension、objectID、category、beginDate、endDate至少选择一个
    :param objectID: 当dimension=1-全市场时该字段为空，当dimension=2-基金公司时，该字段为基金公司代码，可在DataAPI.PartyIDGet通过partyName获取到。,dimension、objectID、category、beginDate、endDate至少选择一个
    :param category: 分类规则：40067-通联分类（投资类型角度）；40002-通联分类（投资对象角度）,可以是列表,dimension、objectID、category、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”。,dimension、objectID、category、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”。,dimension、objectID、category、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundTypeAvg.csv?ispandas=1&') 
    requestString.append("dimension=")
    if hasattr(dimension,'__iter__') and not isinstance(dimension, str):
        if len(dimension) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dimension
            requestString.append(None)
        else:
            requestString.append(','.join(dimension))
    else:
        requestString.append(dimension)
    if not isinstance(objectID, str) and not isinstance(objectID, unicode):
        objectID = str(objectID)

    requestString.append("&objectID=%s"%(objectID))
    requestString.append("&category=")
    if hasattr(category,'__iter__') and not isinstance(category, str):
        if len(category) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = category
            requestString.append(None)
        else:
            requestString.append(','.join(category))
    else:
        requestString.append(category)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundTypeAvgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundTypeAvgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dimension', u'objectID', u'partyName', u'category', u'type', u'typeCode', u'endDate', u'avgReturn', u'avgReturnWtd', u'avgReturn1W', u'avgReturnMtd', u'avgReturn1M', u'avgReturn3M', u'avgReturn6M', u'avgReturnYtd', u'avgReturn1Y', u'avgReturn2Y', u'avgReturn3Y', u'avgReturn5Y']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyName': 'str','category': 'str','type': 'str','typeCode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundQdiiHoldingsGet(fundTicker = "", fundID = "", reportTypeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取QDII基金定期报告中的持股明细情况。收录了2013年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定QDII基金，在一段时间内的持股情况。
    
    :param fundTicker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,fundTicker、fundID至少选择一个
    :param fundID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,fundTicker、fundID至少选择一个
    :param reportTypeCD: 报告类型代码，0101-一季报，0102-二季报，0103-三季报，0104-四季报,可以是列表,可空
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundQdiiHoldings.csv?ispandas=1&') 
    requestString.append("fundTicker=")
    if hasattr(fundTicker,'__iter__') and not isinstance(fundTicker, str):
        if len(fundTicker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fundTicker
            requestString.append(None)
        else:
            requestString.append(','.join(fundTicker))
    else:
        requestString.append(fundTicker)
    requestString.append("&fundID=")
    if hasattr(fundID,'__iter__') and not isinstance(fundID, str):
        if len(fundID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = fundID
            requestString.append(None)
        else:
            requestString.append(','.join(fundID))
    else:
        requestString.append(fundID)
    requestString.append("&reportTypeCD=")
    if hasattr(reportTypeCD,'__iter__') and not isinstance(reportTypeCD, str):
        if len(reportTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(reportTypeCD))
    else:
        requestString.append(reportTypeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundQdiiHoldingsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundQdiiHoldingsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'fundTicker', u'fundID', u'fundShortName', u'fundExchangCD', u'publishDate', u'reportDate', u'reportTypeCD', u'reportType', u'no', u'partyFullNameEn', u'partyShortName', u'ticker', u'exchangeCD', u'exchangeRemark', u'areaCode', u'areaName', u'holdVolume', u'marketValue', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'fundTicker': 'str','fundID': 'str','fundShortName': 'str','fundExchangCD': 'str','reportTypeCD': 'str','reportType': 'str','partyFullNameEn': 'str','partyShortName': 'str','ticker': 'str','exchangeCD': 'str','exchangeRemark': 'str','areaCode': 'str','areaName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundInvestStyleGet(beginDate = "", endDate = "", ticker = "", secID = "", field = "", pandas = "1"):
    """
    依据半年报/年报基金持股情况计算的公募基金规模风格与价值成长风格的数据。更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate可以查询到指定基金指定时间的风格数据。
    
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,beginDate、endDate、ticker、secID至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,beginDate、endDate、ticker、secID至少选择一个
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003"。,可以是列表,beginDate、endDate、ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,beginDate、endDate、ticker、secID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundInvestStyle.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundInvestStyleGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundInvestStyleGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'endDate', u'rawX', u'rawY', u'vertical', u'horizontal']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','endDate': 'str','vertical': 'str','horizontal': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundQdiiHoldingsFGet(ticker = "", secID = "", reportTypeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取QDII基金定期报告中的持仓基金明细。收录了2009年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定QDII基金，在一段时间内的持有基金情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param reportTypeCD: 报告类型代码，0101-一季报，0102-二季报，0103-三季报，0104-四季报,可以是列表,可空
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundQdiiHoldingsF.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportTypeCD=")
    if hasattr(reportTypeCD,'__iter__') and not isinstance(reportTypeCD, str):
        if len(reportTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(reportTypeCD))
    else:
        requestString.append(reportTypeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundQdiiHoldingsFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundQdiiHoldingsFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'publishDate', u'reportDate', u'reportTypeCD', u'reportType', u'no', u'fundName', u'fundType', u'fundTypeSTD', u'operation', u'operationSTD', u'manaCompany', u'marketValue', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','fundName': 'str','fundType': 'str','fundTypeSTD': 'str','operation': 'str','operationSTD': 'str','manaCompany': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundFairValChgGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取基金在半年报、年报中披露的公允价值变动数据。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定基金在定期报告中披露的公允价值变动情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param reportTypeCD: 报告类型代码，0105-半年报，0106-年报。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundFairValChg.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundFairValChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundFairValChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'reportDate', u'startDate', u'endDate', u'isNew', u'itemCD', u'item', u'itemValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','itemCD': 'str','item': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundProfDistGet(ticker = "", secID = "", beginDate = "", endDate = "", reportTypeCD = "", field = "", pandas = "1"):
    """
    获取基金在半年报、年报中披露的利润分配情况。收录了2009年以来的历史数据，数据更新频率为半年度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate以及报告类型，可以查询到指定基金在定期报告中披露的利润分配情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID、beginDate、endDate至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,ticker、secID、beginDate、endDate至少选择一个
    :param reportTypeCD: 报告类型代码，0105-半年报，0106-年报。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundProfDist.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(reportTypeCD, str) and not isinstance(reportTypeCD, unicode):
        reportTypeCD = str(reportTypeCD)

    requestString.append("&reportTypeCD=%s"%(reportTypeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundProfDistGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundProfDistGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'reportTypeCD', u'reportType', u'reportDate', u'endDate', u'dividendPer10', u'totalCashForm', u'totalReinvestForm', u'totalProfit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FundQdiiHoldingsBGet(ticker = "", secID = "", reportTypeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取QDII基金定期报告中的持债明细。收录了2008年以来的历史数据，数据更新频率为季度。获取方式支持：输入一个或多个secID/ticker，并输入beginDate和endDate，可以查询到指定QDII基金，在一段时间内的持有债券情况。
    
    :param ticker: 输入一个或多个基金代码，用","分隔，如"000001"、"000001,000003",可以是列表,ticker、secID至少选择一个
    :param secID: 基金ID，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,ticker、secID至少选择一个
    :param reportTypeCD: 报告类型代码，0101-一季报，0102-二季报，0103-三季报，0104-四季报,可以是列表,可空
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/fund/getFundQdiiHoldingsB.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&reportTypeCD=")
    if hasattr(reportTypeCD,'__iter__') and not isinstance(reportTypeCD, str):
        if len(reportTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(reportTypeCD))
    else:
        requestString.append(reportTypeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FundQdiiHoldingsBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FundQdiiHoldingsBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'secID', u'exchangeCD', u'publishDate', u'reportDate', u'reportTypeCD', u'reportType', u'no', u'bondTicker', u'bondShortName', u'holdVolume', u'marketValue', u'ratioInNa']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','secID': 'str','exchangeCD': 'str','reportTypeCD': 'str','reportType': 'str','bondTicker': 'str','bondShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutuGet(secID = "", ticker = "", exchangeCD = "", contractStatus = "", contractObject = "", field = "", pandas = "1"):
    """
    获取期货交易所期货合约的基本要素信息，包括合约名称、合约代码、合约类型、合约标的、报价单位、最小变动价位、涨跌停板幅度、交易货币、合约乘数、交易保证金、上市日期、最后交易日、交割日期、交割方式、交易手续费、交割手续费、挂牌基准价、合约状态等。
    
    :param secID: 通联编制的证券编码，可通过交易代码、证券类型及交易市场代码在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、exchangeCD、contractStatus至少选择一个
    :param ticker: 合约交易代码,可以是列表,secID、ticker、exchangeCD、contractStatus至少选择一个
    :param exchangeCD: 通联编制的证券市场编码,可以是列表,secID、ticker、exchangeCD、contractStatus至少选择一个
    :param contractStatus: 期货合约状态,可以是列表,secID、ticker、exchangeCD、contractStatus至少选择一个
    :param contractObject: 期货合约标的,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/future/getFutu.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&contractStatus=")
    if hasattr(contractStatus,'__iter__') and not isinstance(contractStatus, str):
        if len(contractStatus) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractStatus
            requestString.append(None)
        else:
            requestString.append(','.join(contractStatus))
    else:
        requestString.append(contractStatus)
    requestString.append("&contractObject=")
    if hasattr(contractObject,'__iter__') and not isinstance(contractObject, str):
        if len(contractObject) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractObject
            requestString.append(None)
        else:
            requestString.append(','.join(contractObject))
    else:
        requestString.append(contractObject)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'listDate', u'secFullName', u'secShortName', u'ticker', u'exchangeCD', u'contractType', u'contractObject', u'priceUnit', u'minChgPriceNum', u'minChgPriceUnit', u'priceValidDecimal', u'limitUpNum', u'limitUpUnit', u'limitDownNum', u'limitDownUnit', u'transCurrCD', u'contMultNum', u'contMultUnit', u'tradeMarginRatio', u'deliYear', u'deliMonth', u'lastTradeDate', u'firstDeliDate', u'lastDeliDate', u'deliMethod', u'deliGrade', u'tradeCommiNum', u'tradeCommiUnit', u'deliCommiNum', u'deliCommiUnit', u'listBasisPrice', u'settPriceMethod', u'deliPriceMethod', u'contractStatus']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secFullName': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str','contractType': 'str','contractObject': 'str','priceUnit': 'str','minChgPriceUnit': 'str','limitUpUnit': 'str','limitDownUnit': 'str','transCurrCD': 'str','contMultUnit': 'str','deliMethod': 'str','deliGrade': 'str','tradeCommiUnit': 'str','deliCommiUnit': 'str','settPriceMethod': 'str','deliPriceMethod': 'str','contractStatus': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutuConvfGet(secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取国债期货转换因子信息，包括合约可交割国债名称、可交割国债交易代码、转换因子等。
    
    :param secID: 通联编制的证券编码,可以是列表,secID、ticker至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/future/getFutuConvf.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutuConvfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutuConvfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'ticker', u'secShortName', u'exchangeCD', u'bondID', u'bondFullName', u'bondTickerIB', u'bondTickerSH', u'bondTickerSZ', u'bondCoupon', u'bondMaturityDate', u'conversionFactor']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','exchangeCD': 'str','bondID': 'str','bondFullName': 'str','bondTickerIB': 'str','bondTickerSZ': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutuLqTodayGet(secID = "", ticker = "", exchangeCD = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    期货合约平今仓手续费信息，包含短线平仓手续费数值及单位、生效日期、截止日期、发布日期等。
    
    :param secID: 通联编制的证券编码，可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 交易代码,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param beginDate: 开始日期，单独使用可获取该日期之前的费率信息。与截止日期一致，同时输入可获取该日期对应的费率,可空
    :param endDate: 截止日期，单独使用可获取该日期之后的费率信息,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/future/getFutuLqToday.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutuLqTodayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutuLqTodayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exchangeCD', u'secShortName', u'publishDate', u'exDate', u'endDate', u'lqValue', u'lqUnit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','exchangeCD': 'str','secShortName': 'str','lqUnit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutIndChgGet(secID = "", ticker = "", indicType = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取期货合约指标变动情况，如涨跌幅限制、保证金率、交易手续费、交割手续费、最小变动价位等。
    
    :param secID: 通联编制的证券编码,可以是列表,secID、ticker至少选择一个
    :param ticker: 合约交易代码,可以是列表,secID、ticker至少选择一个
    :param indicType: 通联编制的指标类型代码，对应DataAPI.SysCodeGet.codeTypeID=10013,可以是列表,可空
    :param beginDate: 开始日期，单独使用可获取该日期之前的指标值。与截止日期一致，同时输入可获取该日期对应的指标值,可空
    :param endDate: 截止日期，单独使用可获取该日期之后的指标值,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/future/getFutIndChg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&indicType=")
    if hasattr(indicType,'__iter__') and not isinstance(indicType, str):
        if len(indicType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicType
            requestString.append(None)
        else:
            requestString.append(','.join(indicType))
    else:
        requestString.append(indicType)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutIndChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutIndChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'indicType', u'indicTypeCN', u'value', u'valueUnit', u'beginDate', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','indicType': 'str','indicTypeCN': 'str','value': 'str','valueUnit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutuHKGet(secID = "", ticker = "", contractType = "", contractObject = "", contractStatus = "", field = "", pandas = "1"):
    """
    获取港交所期货合约基本信息，包含合约乘数、报价单位、交易时间、 结算方式、征费等信息。
    
    :param secID: 合约内部编码，可从DataAPI.SecIDGet获取到,可以是列表,secID、ticker、contractType、contractObject至少选择一个
    :param ticker: 合约在交易所交易代码,可以是列表,secID、ticker、contractType、contractObject至少选择一个
    :param contractType: 合约类型。对应DataAPI.SysCodeGet.codeTypeID=60001。,secID、ticker、contractType、contractObject至少选择一个
    :param contractObject: 合约标的。对应DataAPI.SysCodeGet.codeTypeID=60003。,secID、ticker、contractType、contractObject至少选择一个
    :param contractStatus: 合约状态。对应DataAPI.SysCodeGet.codeTypeID=10005,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/future/getFutuHK.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(contractType, str) and not isinstance(contractType, unicode):
        contractType = str(contractType)

    requestString.append("&contractType=%s"%(contractType))
    if not isinstance(contractObject, str) and not isinstance(contractObject, unicode):
        contractObject = str(contractObject)

    requestString.append("&contractObject=%s"%(contractObject))
    if not isinstance(contractStatus, str) and not isinstance(contractStatus, unicode):
        contractStatus = str(contractStatus)

    requestString.append("&contractStatus=%s"%(contractStatus))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutuHKGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutuHKGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secFullName', u'secShortName', u'ticker', u'exchangeCD', u'contractType', u'contractObject', u'transCurrCD', u'deliYear', u'deliMonth', u'contractStatus', u'contMultNum', u'contractPrice', u'contractPriceUnit', u'priceUnitCd', u'minChgPriceNum', u'maxChgPriceNum', u'price', u'priceUnit', u'deliBondId', u'limitOpenInt', u'largeOpenInt', u'beforeOpen', u'tradeTime', u'lastSettleDate', u'settleMethod', u'settlCurrency', u'deliPlace', u'minDeliUnit', u'tradeFee', u'tradeFeeUnit', u'settleFee', u'settleFeeUnit', u'fee', u'feeUnit', u'exchangeFee', u'exchangeFeeUnit', u'saFee', u'saFeeUnit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secFullName': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str','contractType': 'str','contractObject': 'str','transCurrCD': 'str','contractStatus': 'str','contMultNum': 'str','contractPrice': 'str','contractPriceUnit': 'str','priceUnitCd': 'str','minChgPriceNum': 'str','maxChgPriceNum': 'str','price': 'str','priceUnit': 'str','deliBondId': 'str','limitOpenInt': 'str','largeOpenInt': 'str','beforeOpen': 'str','tradeTime': 'str','lastSettleDate': 'str','settleMethod': 'str','settlCurrency': 'str','deliPlace': 'str','minDeliUnit': 'str','tradeFee': 'str','tradeFeeUnit': 'str','settleFee': 'str','settleFeeUnit': 'str','fee': 'str','feeUnit': 'str','exchangeFee': 'str','exchangeFeeUnit': 'str','saFee': 'str','saFeeUnit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutuHedgMtGet(beginDate, endDate, contractObject = "", contractObjectCN = "", field = "", pandas = "1"):
    """
    获取郑商所期货品种套保持仓信息，包含买卖套保额度及买卖套保持仓量
    
    :param beginDate: 查询起始日期，格式为YYYYMMDD
    :param endDate: 查询截止日期，格式为YYYYMMDD
    :param contractObject: 期货合约标的。例如，CU-阴极铜，AU-黄金等。对应DataAPI.SysCodeGet.codeTypeID=60003。,可以是列表,contractObject、contractObjectCN至少选择一个
    :param contractObjectCN: 期货合约标的中文名称,contractObject、contractObjectCN至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/future/getFutuHedgMt.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&contractObject=")
    if hasattr(contractObject,'__iter__') and not isinstance(contractObject, str):
        if len(contractObject) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractObject
            requestString.append(None)
        else:
            requestString.append(','.join(contractObject))
    else:
        requestString.append(contractObject)
    if not isinstance(contractObjectCN, str) and not isinstance(contractObjectCN, unicode):
        contractObjectCN = str(contractObjectCN)

    requestString.append("&contractObjectCN=%s"%(contractObjectCN))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutuHedgMtGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutuHedgMtGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'contractObject', u'contractObjectCN', u'tradeDate', u'buyHedgingLimit', u'buyHedgingMaintain', u'sellHedgingLimit', u'sellHedgingMaintain']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'contractObject': 'str','contractObjectCN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutuMemGet(memNum = "", exchangeCD = "", shortName = "", memType = "", field = "", pandas = "1"):
    """
    获取交易所期货会员信息，包括会员号、交易所、会员全称、会员简称、会员类型信息。
    
    :param memNum: 期货交易所会员号,可以是列表,memNum、exchangeCD、shortName至少选择一个
    :param exchangeCD: 证券交易市场代码，例如：CCFX-中国金融期货交易所。可在DataAPI.SysCodeGet接口输入codeTypeID=10002获取到,可以是列表,memNum、exchangeCD、shortName至少选择一个
    :param shortName: 会员简称,可以是列表,memNum、exchangeCD、shortName至少选择一个
    :param memType: 期货交易所会员类型，例如：交易会员；交易结算会员；全面结算会员等。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/future/getFutuMem.csv?ispandas=1&') 
    requestString.append("memNum=")
    if hasattr(memNum,'__iter__') and not isinstance(memNum, str):
        if len(memNum) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = memNum
            requestString.append(None)
        else:
            requestString.append(','.join(memNum))
    else:
        requestString.append(memNum)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&shortName=")
    if hasattr(shortName,'__iter__') and not isinstance(shortName, str):
        if len(shortName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = shortName
            requestString.append(None)
        else:
            requestString.append(','.join(shortName))
    else:
        requestString.append(shortName)
    requestString.append("&memType=")
    if hasattr(memType,'__iter__') and not isinstance(memType, str):
        if len(memType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = memType
            requestString.append(None)
        else:
            requestString.append(','.join(memType))
    else:
        requestString.append(memType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutuMemGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutuMemGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'memNum', u'exchangeCD', u'shortName', u'fullName', u'memType', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'memNum': 'str','exchangeCD': 'str','shortName': 'str','fullName': 'str','memType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoBarRTIntraDayGet(currencyPair, field = "", pandas = "1"):
    """
    获取一种数字货币对在当日内分钟信息，每小时更新一次
    
    :param currencyPair: 货币对代码，可根据DataAPI.SecIDGet获取assetClass为“CP”，交易市场为“CCGG”的货币对
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volumeFrom', u'volumeTo']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoBarHistOneDayGet(currencyPair, tradeDate, beginTime = "", endTime = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取某一个数字货币货币对在历史某一交易日的分钟线数据，包含分钟内开盘价、最高价、最低价、收盘价
    
    :param currencyPair: 货币对代码，可根据DataAPI.SecIDGet获取assetClass为“CP”，目前只支持交易市场为“CCGG”的货币对
    :param tradeDate: 交易日期，格式为YYYYMMDD
    :param beginTime: 分钟线查询起始时间，格式为HH:SS,可空
    :param endTime: 分钟线查询截止时间，格式为HH:SS,可空
    :param exchangeCD: 通联编制的证券市场编码。目前只支持CCGG，DataAPI.SysCodeGet.codeTypeID=10002。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoBarHistOneDay.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'exchangeCD', u'barTime', u'tradeDate', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volumeFrom', u'volumeTo']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','exchangeCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayGDAXGet(dataDate, currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取GDAX某一货币对在历史某一交易日的Tick数据
    
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param currencyPair: 货币对，目前支持货币对：BCH|BTC；BCH|USD；BTC|EUR；BTC|GBP；BTC|USD；ETH|BTC；ETH|EUR；ETH|USD；LTC|BTC；LTC|EUR；LTC|USD；BCH|EUR
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayGDAX.csv?ispandas=1&') 
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("dataDate=%s"%(dataDate))
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("&currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'tradeID', u'currencyPair', u'lastPrice', u'openPrice', u'highPrice', u'lowPrice', u'lastVolume', u'volume24h', u'volume30d', u'B1', u'S1', u'side', u'sequence']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayGDAXGet(dataDate, currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取GDAX某一货币对在历史某一交易日的逐笔成交数据
    
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param currencyPair: 货币对，目前支持货币对：BCH|BTC；BCH|USD；BTC|EUR；BTC|GBP；BTC|USD；ETH|BTC；ETH|EUR；ETH|USD；LTC|BTC；LTC|EUR；LTC|USD；BCH|EUR
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayGDAX.csv?ispandas=1&') 
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("dataDate=%s"%(dataDate))
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("&currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayGDAXGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取GDAX某一货币对在当日内的Tick数据，包含开盘价、最高价、最低价、最新价、成交量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayGDAX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'tradeID', u'currencyPair', u'lastPrice', u'openPrice', u'highPrice', u'lowPrice', u'lastVolume', u'volume24h', u'volume30d', u'B1', u'S1', u'side']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayGDAXGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取GDAX某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayGDAX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayGDAXGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取GDAX某一货币对在当日内的盘口信息数据，包括档位、委托价格和委托量等信息。
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayGDAX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayBitstampGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对在当日内的Tick数据，包含开盘价、最高价、最低价、最新价、买卖方向，买方交易ID和卖方交易ID等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'tradeID', u'currencyPair', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'side', u'volume', u'bidOrderID', u'askOrderID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayBitstampGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'tradeID', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayBitstampGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对在当日内的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayGeminiGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Gemini某一货币对在当日内的Tick数据，包含开盘价、最高价、最低价、最新价、成交量、买一价、卖一价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'lastPrice', u'openPrice', u'highPrice', u'lowPrice', u'volume', u'B1', u'BV1', u'S1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoAuctionRTIntraDayGeminiGet(currencyPair, field = "", pandas = "1"):
    """
    获取Gemini某一货币对在当日内的竞价数据，包含事件ID、成交价格、成交量、最优买价，最优卖价、中间价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoAuctionRTIntraDayGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoAuctionRTIntraDayGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoAuctionRTIntraDayGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'event', u'auctionID', u'aucEidIDEid', u'auctionDate', u'auctionTime', u'isAucSuc', u'aucPrice', u'aucQty', u'B1', u'S1', u'collarPrice']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','event': 'str','aucEidIDEid': 'str','auctionTime': 'str','isAucSuc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayGeminiGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Gemini某一货币对在当日内的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayItbitGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Itbit某一货币对在当日内的Tick数据，包含开盘价、最高价、24小时最高、最低价、24小时最低、最新价、最新成交量、24小时累计成交量、当日成交量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'openPrice', u'highPrice', u'high24h', u'lowPrice', u'low24h', u'lastPrice', u'lastVolume', u'volume', u'volume24h', u'vwap', u'vwap24h', u'B1', u'BV1', u'S1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayItbitGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Itbit某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'tradeID', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayItbitGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Itbit某一货币对在当日内的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayKrakenGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Kraken某一货币对在当日内的Tick数据，包含开盘价、最高价、24小时最高、最低价、24小时最低、最新价、最新成交量、24小时累计成交量、当日成交量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'openPrice', u'highPrice', u'high24h', u'lowPrice', u'low24h', u'lastPrice', u'lastVolume', u'vwap', u'vwap24h', u'volume', u'volume24h', u'deal', u'deal24h', u'B1', u'BV1', u'S1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayKrakenGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Kraken某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'price', u'volume', u'side', u'priceType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str','priceType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayKrakenGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Kraken某一货币对在当日内的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'receiveTime', u'dataTime', u'currencyPair', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'receiveTime': 'str','dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayCMCGet(coinName, field = "", pandas = "1"):
    """
    获取CoinMarketCap某一数字货币在当日内的市值信息，包含货币排名、美元兑价、比特币兑价、市值_美元、总供给量、流通供给量等信息
    
    :param coinName: 货币代码，如BTC、LTC,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayCMC.csv?ispandas=1&') 
    requestString.append("coinName=")
    if hasattr(coinName,'__iter__') and not isinstance(coinName, str):
        if len(coinName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = coinName
            requestString.append(None)
        else:
            requestString.append(','.join(coinName))
    else:
        requestString.append(coinName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayCMCGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayCMCGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'coinName', u'secShortName', u'rank', u'priceUSD', u'priceBTC', u'volume24hUSD', u'marketCapUSD', u'availSupply', u'totalSupply', u'maxSupply', u'pct1h', u'pct24h', u'pct7d']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','coinName': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoGlobalTickRTIntraDayCMCGet(field = "", pandas = "1"):
    """
    获取CoinMarketCap当日内统计的全市场市值信息，包含全市场市值_美元、24小时成交量、活跃货币数、活跃资产数等信息
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoGlobalTickRTIntraDayCMC.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoGlobalTickRTIntraDayCMCGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoGlobalTickRTIntraDayCMCGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'totalMatCapUSD', u'total24hVolumeUSD', u'btcPctMarketCap', u'activeCurrencies', u'activeAssets', u'activeMarkets']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayGDAXGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取GDAX某一货币对历史某日的盘口信息数据，包括档位、委托价格和委托量等信息。
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayGDAX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayBitstampGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对历史某日的Tick数据，包含开盘价、最高价、最低价、最新价、买卖方向，买方交易ID和卖方交易ID等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'tradeID', u'currencyPair', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'side', u'volume', u'bidOrderID', u'askOrderID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayBitstampGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对历史某日的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'tradeID', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayBitstampGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对历史某日的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayGeminiGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Gemini某一货币对历史某日的Tick数据，包含开盘价、最高价、最低价、最新价、成交量、买一价、卖一价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'lastPrice', u'openPrice', u'highPrice', u'lowPrice', u'volume', u'B1', u'BV1', u'S1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoAuctionHistOneDayGeminiGet(currencyPair, dataDate, field = "", pandas = "1"):
    """
    获取Gemini某一货币对历史某日的竞价数据，包含事件ID、成交价格、成交量、最优买价，最优卖价、中间价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoAuctionHistOneDayGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoAuctionHistOneDayGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoAuctionHistOneDayGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'event', u'auctionID', u'aucEidIDEid', u'auctionDate', u'auctionTime', u'isAucSuc', u'aucPrice', u'aucQty', u'B1', u'S1', u'collarPrice']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','event': 'str','aucEidIDEid': 'str','auctionTime': 'str','isAucSuc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayGeminiGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Gemini某一货币对历史某日的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayItbitGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Itbit某一货币对历史某日的Tick数据，包含开盘价、最高价、24小时最高、最低价、24小时最低、最新价、最新成交量、24小时累计成交量、当日成交量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'openPrice', u'highPrice', u'high24h', u'lowPrice', u'low24h', u'lastPrice', u'lastVolume', u'volume', u'volume24h', u'vwap', u'vwap24h', u'B1', u'BV1', u'S1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayItbitGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Itbit某一货币对历史某日的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'tradeID', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayItbitGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Itbit某一货币对历史某日的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayKrakenGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Kraken某一货币对历史某日的Tick数据，包含开盘价、最高价、24小时最高、最低价、24小时最低、最新价、最新成交量、24小时累计成交量、当日成交量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'openPrice', u'highPrice', u'high24h', u'lowPrice', u'low24h', u'lastPrice', u'lastVolume', u'vwap', u'vwap24h', u'volume', u'volume24h', u'deal', u'deal24h', u'B1', u'BV1', u'S1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayKrakenGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Kraken某一货币对历史某日的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'price', u'volume', u'side', u'priceType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str','priceType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayKrakenGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Kraken某一货币对历史某日的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'receiveTime', u'dataTime', u'currencyPair', u'side', u'level', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'receiveTime': 'str','dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayCMCGet(dataDate, coinName, field = "", pandas = "1"):
    """
    获取CoinMarketCap某一数字货币历史某日的市值信息，包含货币排名、美元兑价、比特币兑价、市值_美元、总供给量、流通供给量等信息
    
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param coinName: 货币代码，如BTC、LTC,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayCMC.csv?ispandas=1&') 
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("dataDate=%s"%(dataDate))
    requestString.append("&coinName=")
    if hasattr(coinName,'__iter__') and not isinstance(coinName, str):
        if len(coinName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = coinName
            requestString.append(None)
        else:
            requestString.append(','.join(coinName))
    else:
        requestString.append(coinName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayCMCGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayCMCGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'coinName', u'secShortName', u'rank', u'priceUSD', u'priceBTC', u'volume24hUSD', u'marketCapUSD', u'availSupply', u'totalSupply', u'maxSupply', u'pct1h', u'pct24h', u'pct7d']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','coinName': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoGlobalTickHistOneDayCMCGet(dataDate, field = "", pandas = "1"):
    """
    获取CoinMarketCap历史某日全市场市值信息，包含全市场市值_美元、24小时成交量、活跃货币数、活跃资产数等信息
    
    :param dataDate: 交易日期，格式为YYYYMMDD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoGlobalTickHistOneDayCMC.csv?ispandas=1&') 
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("dataDate=%s"%(dataDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoGlobalTickHistOneDayCMCGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoGlobalTickHistOneDayCMCGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'totalMatCapUSD', u'total24hVolumeUSD', u'btcPctMarketCap', u'activeCurrencies', u'activeAssets', u'activeMarkets']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotGDAXGet(currencyPair, field = "", pandas = "1"):
    """
    获取GDAX某一货币对当前市场信息快照，包含开盘价、最高价、最低价、最新价、成交量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD，可根据DataAPI.SecIDGet获取(assetClass为“CP”，exchangeCD为“GDAX”),可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotGDAX.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'lastPrice', u'openPrice', u'highPrice', u'lowPrice', u'lastVolume', u'volume24h', u'volume30d', u'B1', u'S1', u'side']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotGDAXGet(currencyPair, field = "", pandas = "1"):
    """
    获取GDAX某一货币对最新成交信息，包含成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD，可根据DataAPI.SecIDGet获取(assetClass为“CP”，exchangeCD为“GDAX”)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotGDAX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotGDAXGet(currencyPair, field = "", pandas = "1"):
    """
    获取GDAX某一货币对当前盘口信息数据，包括委买和委卖信息。
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotGDAX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotGDAXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotGDAXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotBitstampGet(currencyPair, field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对当前市场信息快照，包含开盘价、最高价、最低价、最新价、买卖方向，买方交易ID和卖方交易ID等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'tradeID', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'side', u'volume', u'bidOrderID', u'askOrderID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotBitstampGet(currencyPair, field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对最新成交信息，包含成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'tradeID', u'price', u'volume', u'side']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotBitstampGet(currencyPair, field = "", pandas = "1"):
    """
    获取Bitstamp某一货币对当前的盘口信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotBitstamp.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotBitstampGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotBitstampGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask', u'timestamp']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str','timestamp': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotGeminiGet(currencyPair, field = "", pandas = "1"):
    """
    获取Gemini某一货币对当前市场信息快照，包含开盘价、最高价、最低价、最新价、成交量、买一价、卖一价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'eventID', u'lastPrice', u'openPrice', u'highPrice', u'lowPrice', u'volume', u'B1', u'S1', u'BV1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoAuctionRTSnapshotGeminiGet(currencyPair, field = "", pandas = "1"):
    """
    获取Gemini某一货币对当前竞价情况，包含事件ID、成交价格、成交量、最优买价，最优卖价、中间价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoAuctionRTSnapshotGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoAuctionRTSnapshotGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoAuctionRTSnapshotGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'event', u'auctionID', u'aucEidIDEid', u'auctionDate', u'auctionTime', u'isAucSuc', u'aucPrice', u'aucQty', u'B1', u'S1', u'collarPrice']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','event': 'str','aucEidIDEid': 'str','auctionTime': 'str','isAucSuc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotGeminiGet(currencyPair, field = "", pandas = "1"):
    """
    获取Gemini某一货币对在当日内的盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotGemini.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotGeminiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotGeminiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotItbitGet(currencyPair, field = "", pandas = "1"):
    """
    获取Itbit某一货币对当前市场信息快照，包含开盘价、最高价、24小时最高、最低价、24小时最低、最新价、最新成交量、24小时累计成交量、当日成交量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'openPrice', u'highPrice', u'high24h', u'lowPrice', u'low24h', u'lastPrice', u'lastVolume', u'volume', u'volume24h', u'vwap', u'vwap24h', u'B1', u'BV1', u'S1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotItbitGet(currencyPair, field = "", pandas = "1"):
    """
    获取Itbit某一货币对最新成交信息，包含成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'tradeID', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotItbitGet(currencyPair, field = "", pandas = "1"):
    """
    获取Itbit某一货币对当前盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotItbit.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotItbitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotItbitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'receiveTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','receiveTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotKrakenGet(currencyPair, field = "", pandas = "1"):
    """
    获取Kraken某一货币对当前市场信息快照，包含开盘价、最高价、24小时最高、最低价、24小时最低、最新价、最新成交量、24小时累计成交量、当日成交量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'openPrice', u'highPrice', u'high24h', u'lowPrice', u'low24h', u'lastPrice', u'lastVolume', u'vwap', u'vwap24h', u'volume', u'volume24h', u'deal', u'deal24h', u'B1', u'BV1', u'S1', u'SV1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotKrakenGet(currencyPair, field = "", pandas = "1"):
    """
    获取Kraken某一货币对最新成交信息，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'price', u'volume', u'side', u'priceType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','priceType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotKrakenGet(currencyPair, field = "", pandas = "1"):
    """
    获取Kraken某一货币对当前盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotKraken.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotKrakenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotKrakenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'receiveTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','receiveTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotCMCGet(field = "", pandas = "1"):
    """
    获取CoinMarketCap某一数字货币当前市值信息，包含货币排名、美元兑价、比特币兑价、市值_美元、总供给量、流通供给量等信息
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotCMC.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotCMCGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotCMCGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secShortName', u'coinName', u'dataDate', u'dataTime', u'rank', u'priceUSD', u'priceBTC', u'volume24hUSD', u'marketCapUSD', u'availSupply', u'totalSupply', u'maxSupply', u'pct1h', u'pct24h', u'pct7d']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secShortName': 'str','coinName': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoGlobalTickRTSnapshotCMCGet(field = "", pandas = "1"):
    """
    获取CoinMarketCap前全市场市值信息，包含全市场市值_美元、24小时成交量、活跃货币数、活跃资产数等信息
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoGlobalTickRTSnapshotCMC.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoGlobalTickRTSnapshotCMCGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoGlobalTickRTSnapshotCMCGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'totalMatCapUSD', u'total24hVolumeUSD', u'btcPctMarketCap', u'activeCurrencies', u'activeAssets', u'activeMarkets']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','totalMatCapUSD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickRTIntraDayCFGet(instrumentID, startTime, endTime, field = "", pandas = "1"):
    """
    获取Crypto Facilities交易所某一期货合约在当日内Tick数据,包含开盘价、最高价、最低价、最新价、成交量、最优买卖一档等信息
    
    :param instrumentID: 合约交易代码，可在getFutuCrypto中查询,可以是列表
    :param startTime: 查询起始时间，格式为HH:MM:SS.000
    :param endTime: 查询截止时间，格式为HH:MM:SS.000
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickRTIntraDayCF.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickRTIntraDayCFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickRTIntraDayCFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dateTime', u'instrumentID', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'volume', u'B1', u'BV1', u'S1', u'SV1', u'dtm', u'leverage', u'premium', u'change']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dateTime': 'str','instrumentID': 'str','leverage': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickRTSnapshotCFGet(instrumentID, field = "", pandas = "1"):
    """
    获取Crypto Facilities交易所某一期货合约最新市场信息快照,包含开盘价、最高价、最低价、最新价、成交量、最优买卖一档等信息
    
    :param instrumentID: 合约交易代码，可在getFutuCrypto中查询,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickRTSnapshotCF.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickRTSnapshotCFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickRTSnapshotCFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dateTime', u'lastPrice', u'openPrice', u'highPrice', u'lowPrice', u'B1', u'BV1', u'S1', u'SV1', u'lastVolume', u'volume', u'dtm', u'leverage', u'premium', u'change']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dateTime': 'str','lastPrice': 'str','openPrice': 'str','highPrice': 'str','lowPrice': 'str','B1': 'str','BV1': 'str','S1': 'str','SV1': 'str','lastVolume': 'str','volume': 'str','leverage': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutOrderRTIntraDayCFGet(instrumentID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Crypto Facilities交易所某一期货合约在当日内Order数据，包含当日的买卖档位信息
    
    :param instrumentID: 合约交易代码，可在getFutuCrypto中查询
    :param startTime: 查询起始时间，格式为hh:mm:ss.xxx,可空
    :param endTime: 查询截止时间，格式为hh:mm:ss.xxx,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutOrderRTIntraDayCF.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutOrderRTIntraDayCFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutOrderRTIntraDayCFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'instrumentID', u'level', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','instrumentID': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutOrderRTSnapshotCFGet(instrumentID, field = "", pandas = "1"):
    """
    获取Crypto Facilities交易所某一期货合约最新盘口信息，包含最新的买卖档位信息
    
    :param instrumentID: 合约交易代码，可在getFutuCrypto中查询,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutOrderRTSnapshotCF.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutOrderRTSnapshotCFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutOrderRTSnapshotCFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotBitfinexGet(currencyPair, field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对当前盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotBitfinex.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotBitfinexGet(currencyPair, field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对最新成交信息，包含成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotBitfinex.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayBitfinexGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询起始时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayBitfinex.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayBitfinexGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对在当日内的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询起始时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayBitfinex.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'openPrice', u'high24h', u'low24h', u'lastPrice', u'volume24h', u'chg', u'chgPct', u'B1', u'BV1', u'S1', u'SV1', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotBinanceGet(currencyPair, field = "", pandas = "1"):
    """
    获取Binance某一货币对当前盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotBinance.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotBinanceGet(currencyPair, field = "", pandas = "1"):
    """
    获取Binance某一货币对最新成交信息，包含成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotBinance.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'eventTime', u'tradeID', u'price', u'volume', u'buyOrderID', u'SellOrderID', u'dataTime', u'isBuyerMarketMaker']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','eventTime': 'str','dataTime': 'str','isBuyerMarketMaker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayBinanceGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Binance某一货币对在当日内的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截至时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayBinance.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'preClosePrice', u'openPrice', u'high24h', u'low24h', u'lastPrice', u'volume', u'baTotalVolume', u'qaTotalVolume', u'wAvgPrice', u'chg', u'chgPct', u'B1', u'BV1', u'S1', u'SV1', u'statsOpenTime', u'statsCloseTime', u'firstTradeID', u'lastTradeID', u'totalNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayBinanceGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Binance某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截至时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayBinance.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'eventTime', u'currencyPair', u'tradeID', u'price', u'volume', u'buyOrderID', u'SellOrderID', u'isBuyerMarketMaker']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','eventTime': 'str','currencyPair': 'str','isBuyerMarketMaker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotHitbtcGet(currencyPair, field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对当前盘口信息数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotHitbtc.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotHitbtcGet(currencyPair, field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对最新成交信息，包含成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotHitbtc.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayHitbtcGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对在当日内的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截至时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayHitbtc.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'openPrice', u'high24h', u'low24h', u'lastPrice', u'volume24h', u'volumeQuote', u'B1', u'S1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayHitbtcGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截至时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayHitbtc.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotBinanceGet(currencyPair, field = "", pandas = "1"):
    """
    获取Binance某一货币对最新Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotBinance.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'chg', u'chgPct', u'wAvgPrice', u'preClosePrice', u'lastPrice', u'volume', u'B1', u'BV1', u'S1', u'SV1', u'openPrice', u'high24h', u'low24h', u'baTotalVolume', u'qaTotalVolume', u'statsOpenTime', u'statsCloseTime', u'firstTradeID', u'lastTradeID', u'totalNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotBitfinexGet(currencyPair, field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对最新Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotBitfinex.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'lastPrice', u'volume24h', u'chg', u'chgPct', u'high24h', u'low24h', u'S1', u'SV1', u'B1', u'BV1', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotHitbtcGet(currencyPair, field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对最新Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotHitbtc.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'volumeQuote', u'lastPrice', u'high24h', u'openPrice', u'low24h', u'S1', u'B1', u'volume24h']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayBitfinexGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对在当日内的盘口数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayBitfinex.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'level', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayBinanceGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Binance某一货币对在当日内的盘口数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayBinance.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'level', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayHitbtcGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对在当日内的盘口数据
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param startTime: 查询起始时间(UTC),格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间(UTC),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayHitbtc.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'level', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayBinanceGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Binance某一货币对历史某日的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截至时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayBinance.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'eventTime', u'tradeID', u'price', u'volume', u'buyOrderID', u'SellOrderID', u'isBuyerMarketMaker']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','eventTime': 'str','isBuyerMarketMaker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayBinanceGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Binance某一货币对历史某日的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截至时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayBinance.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'chg', u'chgPct', u'preClosePrice', u'wAvgPrice', u'lastPrice', u'volume', u'B1', u'BV1', u'S1', u'SV1', u'openPrice', u'high24h', u'low24h', u'baTotalVolume', u'qaTotalVolume', u'statsOpenTime', u'statsCloseTime', u'firstTradeID', u'lastTradeID', u'totalNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayHitbtcGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对历史某日的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截至时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayHitbtc.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayHitbtcGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对历史某日的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截至时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayHitbtc.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'volumeQuote', u'lastPrice', u'high24h', u'openPrice', u'low24h', u'S1', u'B1', u'volume24h']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayBitfinexGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对历史某日的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayBitfinex.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayBitfinexGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对历史某日的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间(UTC时间),格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayBitfinex.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'lastPrice', u'volume24h', u'chg', u'chgPct', u'openPrice', u'high24h', u'low24h', u'B1', u'BV1', u'S1', u'SV1', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotHuobiproGet(currencyPair, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对当前盘口信息数据
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotHuobipro.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotHuobiproGet(currencyPair, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对最新成交信息数据，包含成交的价格及成交量
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotHuobipro.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotHuobiproGet(currencyPair, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对最新Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotHuobipro.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'lastVolume', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoBarRTSnapshotHuobiproGet(currencyPair, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对当前分钟线信息数据,包括开盘价、最高价、最低价、收盘价等信息
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoBarRTSnapshotHuobipro.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoBarRTSnapshotHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoBarRTSnapshotHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'barTime', u'volume', u'deal', u'openPrice', u'closePrice', u'lowPrice', u'highPrice', u'value', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','barTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayHuobiproGet(currencyPair, startTime, endTime, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对在当日内的盘口数据
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为1小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为1小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayHuobipro.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayHuobiproGet(currencyPair, startTime, endTime, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对在当日内的逐笔成交信息数据，包含成交价和成交量等信息
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayHuobipro.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayHuobiproGet(currencyPair, startTime, endTime, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对在当日内的Tick信息数据，包含开盘价、最高价、最低价、最新价、累计成交量等信息
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayHuobipro.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'lastVolume', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','currencyPair': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoBarRTIntraDayHuobiproGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Huobipro某一货币对在当日内的分钟线数据,包括开盘价、最高价、最低价、收盘价等信息
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 分钟线查询起始时间,格式为HH:MM,可空
    :param endTime: 分钟线查询截止时间,格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoBarRTIntraDayHuobipro.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoBarRTIntraDayHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoBarRTIntraDayHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'barTime', u'volume', u'deal', u'openPrice', u'closePrice', u'lowPrice', u'highPrice', u'value', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','barTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotOKEXGet(currencyPair, field = "", pandas = "1"):
    """
    获取OKEX某一货币对当前盘口信息数据,包含买卖方向,委托价,委托量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotOKEX.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotOKEXGet(currencyPair, field = "", pandas = "1"):
    """
    获取OKEX某一货币对最新成交信息数据，包含最新的成交价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotOKEX.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotOKEXGet(currencyPair, field = "", pandas = "1"):
    """
    获取OKEX某一货币对最新Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotOKEX.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'high24h', u'volume24h', u'lastPrice', u'low24h', u'B1', u'S1', u'openPrice', u'LocalTime', u'open24h', u'volumeQ24h']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoBarRTSnapshotOKEXGet(currencyPair, field = "", pandas = "1"):
    """
    获取OKEX某一货币对当前分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoBarRTSnapshotOKEX.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoBarRTSnapshotOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoBarRTSnapshotOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','barTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayOKEXGet(currencyPair, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一货币对在当日内的盘口数据,包含买卖方向,委托价,委托量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayOKEX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayOKEXGet(currencyPair, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayOKEX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayOKEXGet(currencyPair, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一货币对在当日内的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayOKEX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'openPrice', u'high24h', u'volume24h', u'low24h', u'lastPrice', u'B1', u'S1', u'LocalTime', u'open24h', u'volumeQ24h']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoBarRTIntraDayOKEXGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取OKEX某一货币对在当日内的分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 分钟线起始时间,格式为HH:MM,可空
    :param endTime: 分钟线截止时间,格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoBarRTIntraDayOKEX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoBarRTIntraDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoBarRTIntraDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','barTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTransRTSnapshotOKEXGet(instrumentID, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约最新成交信息数据，包含最新的成交价格及成交量
    
    :param instrumentID: 合约交易代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTransRTSnapshotOKEX.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTransRTSnapshotOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTransRTSnapshotOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'volumeCoin', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','side': 'str','volumeCoin': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickRTSnapshotOKEXGet(instrumentID, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约最新Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param instrumentID: 合约交易代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickRTSnapshotOKEX.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickRTSnapshotOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickRTSnapshotOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'openPrice', u'high24h', u'volume24h', u'low24h', u'lastPrice', u'B1', u'S1', u'unitAmount', u'openInt', u'LocalTime', u'open24h', u'volumeT24h']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutBarRTSnapshotOKEXGet(instrumentID, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约当前分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param instrumentID: 合约交易代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutBarRTSnapshotOKEX.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutBarRTSnapshotOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutBarRTSnapshotOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volume', u'volumeCoin', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','barTime': 'str','volumeCoin': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutOrderRTIntraDayOKEXGet(instrumentID, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约在当日内的盘口数据,包含买卖方向,委托价,委托量等信息
    
    :param instrumentID: 合约交易代码
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutOrderRTIntraDayOKEX.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutOrderRTIntraDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutOrderRTIntraDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTransRTIntraDayOKEXGet(instrumentID, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param instrumentID: 合约交易代码
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTransRTIntraDayOKEX.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTransRTIntraDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTransRTIntraDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'volumeCoin', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','side': 'str','volumeCoin': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickRTIntraDayOKEXGet(instrumentID, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约在当日内的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param instrumentID: 合约交易代码
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickRTIntraDayOKEX.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickRTIntraDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickRTIntraDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'openPrice', u'high24h', u'volume24h', u'low24h', u'lastPrice', u'B1', u'S1', u'unitAmount', u'openInt', u'LocalTime', u'open24h', u'volumeT24h']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutBarRTIntraDayOKEXGet(instrumentID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取OKEX某一期货合约在当日内的分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param instrumentID: 合约交易代码
    :param startTime: 分钟线起始时间,格式为HH:MM,可空
    :param endTime: 分钟线截止时间,格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutBarRTIntraDayOKEX.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutBarRTIntraDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutBarRTIntraDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volume', u'volumeCoin', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','barTime': 'str','volumeCoin': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayBitfinexGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Bitfinex某一货币对历史某日的盘口数据,包含委托价,委托量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayBitfinex.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayBitfinexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayBitfinexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'level', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayBinanceGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Binance某一货币对历史某日的盘口数据,包含委托价,委托量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayBinance.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayBinanceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayBinanceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'level', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayHitbtcGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Hitbtc某一货币对历史某日的盘口数据,包含委托价,委托量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USD
    :param dataDate: 交易日期
    :param startTime: 查询起始时间，格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayHitbtc.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayHitbtcGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayHitbtcGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'level', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickHistOneDayCFGet(instrumentID, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Crypto Facilities交易所某一期货合约在历史某交易日Tick数据,包含开盘价、最高价、最低价、最新价、成交量、最优买卖一档等信息
    
    :param instrumentID: 合约交易代码，可在getFutuCrypto中查询
    :param dataDate: 交易日期
    :param startTime: 查询起始时间，格式为HH:MM:SS.000,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.000,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickHistOneDayCF.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickHistOneDayCFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickHistOneDayCFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dateTime', u'instrumentID', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'volume', u'B1', u'BV1', u'S1', u'SV1', u'dtm', u'leverage', u'premium', u'change']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dateTime': 'str','instrumentID': 'str','leverage': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutOrderHistOneDayCFGet(instrumentID, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Crypto Facilities交易所某一期货合约在历史某交易日Order数据，包含历史某日的买卖档位信息
    
    :param instrumentID: 合约交易代码，可在getFutuCrypto中查询
    :param dataDate: 交易日期
    :param startTime: 查询起始时间，格式为HH:MM:SS.000,可空
    :param endTime: 查询截止时间，格式为HH:MM:SS.000,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutOrderHistOneDayCF.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutOrderHistOneDayCFGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutOrderHistOneDayCFGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'instrumentID', u'level', u'side', u'price', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','instrumentID': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutOrderRTSnapshotBitMexGet(instrumentID, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约最新盘口信息，包含当前的委托价，委托量等信息
    
    :param instrumentID: 交易市场合约交易代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutOrderRTSnapshotBitMex.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutOrderRTSnapshotBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutOrderRTSnapshotBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'bid', u'ask', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','bid': 'str','ask': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTransRTSnapshotBitMexGet(instrumentID, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约最新成交信息数据，包含最新的成交价格及成交量
    
    :param instrumentID: 交易市场合约交易代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTransRTSnapshotBitMex.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTransRTSnapshotBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTransRTSnapshotBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'tradeID', u'side', u'price', u'volume', u'tickDirection', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','tradeID': 'str','side': 'str','tickDirection': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickRTSnapshotBitMexGet(instrumentID, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约最新Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param instrumentID: 交易市场合约交易代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickRTSnapshotBitMex.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickRTSnapshotBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickRTSnapshotBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'lastVolume', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutBarRTSnapshotBitMexGet(instrumentID, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约当前分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param instrumentID: 合约交易代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutBarRTSnapshotBitMex.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutBarRTSnapshotBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutBarRTSnapshotBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'lastVolume', u'volume', u'deal', u'vwap', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','barTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutOrderRTIntraDayBitMexGet(instrumentID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取BitMex某一期货合约在当日内盘口信息，包含当前的委托价，委托量等信息
    
    :param instrumentID: 交易市场合约交易代码
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为1小时),可空
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为1小时),可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutOrderRTIntraDayBitMex.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutOrderRTIntraDayBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutOrderRTIntraDayBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'bid', u'ask', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','bid': 'str','ask': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTransRTIntraDayBitMexGet(instrumentID, startTime, endTime, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约在当日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param instrumentID: 交易市场合约交易代码
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTransRTIntraDayBitMex.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTransRTIntraDayBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTransRTIntraDayBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'tradeID', u'side', u'price', u'volume', u'tickDirection', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','tradeID': 'str','side': 'str','tickDirection': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickRTIntraDayBitMexGet(instrumentID, startTime, endTime, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约在当日内Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param instrumentID: 交易市场合约交易代码
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickRTIntraDayBitMex.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickRTIntraDayBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickRTIntraDayBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'lastVolume', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutBarRTIntraDayBitMexGet(instrumentID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取BitMex某一期货合约在当日内分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param instrumentID: 合约交易代码
    :param startTime: 查询起始时间,格式为HH:MM,可空
    :param endTime: 查询截止时间,格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutBarRTIntraDayBitMex.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutBarRTIntraDayBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutBarRTIntraDayBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'lastVolume', u'volume', u'deal', u'vwap', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','barTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayOKEXGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一货币对在历史某日内的盘口数据,包含买卖方向,委托价,委托量等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日期,格式为YYYYMM
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayOKEX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataDate': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayOKEXGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一货币对在历史某日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日期,格式为YYYYMM
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayOKEX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataDate': 'str','dataTime': 'str','side': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayOKEXGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一货币对在历史某日内的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日期,格式为YYYYMM
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayOKEX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'openPrice', u'high24h', u'volume24h', u'low24h', u'lastPrice', u'B1', u'S1', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataDate': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoBarHistOneDayOKEXGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取OKEX某一货币对在历史某日内的分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param currencyPair: 货币对编码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日期,格式为YYYYMM
    :param startTime: 分钟线起始时间,格式为HH:MM,可空
    :param endTime: 分钟线截止时间,格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoBarHistOneDayOKEX.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoBarHistOneDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoBarHistOneDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataDate': 'str','barTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutOrderHistOneDayOKEXGet(instrumentID, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约在历史某日内的盘口数据,包含买卖方向,委托价,委托量等信息
    
    :param instrumentID: 合约交易代码
    :param dataDate: 交易日期,格式为YYYYMM
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutOrderHistOneDayOKEX.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutOrderHistOneDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutOrderHistOneDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTransHistOneDayOKEXGet(instrumentID, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约在历史某日内的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param instrumentID: 合约交易代码
    :param dataDate: 交易日期,格式为YYYYMM
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTransHistOneDayOKEX.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTransHistOneDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTransHistOneDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'volumeCoin', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','dataTime': 'str','side': 'str','volumeCoin': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickHistOneDayOKEXGet(instrumentID, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取OKEX某一期货合约在历史某日内的Tick数据，包含开盘价、最高价、最低价、最新价等信息
    
    :param instrumentID: 合约交易代码
    :param dataDate: 交易日期,格式为YYYYMM
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickHistOneDayOKEX.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickHistOneDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickHistOneDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'openPrice', u'high24h', u'volume24h', u'low24h', u'lastPrice', u'B1', u'S1', u'unitAmount', u'openInt', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutBarHistOneDayOKEXGet(instrumentID, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取OKEX某一期货合约在历史某日内的分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param instrumentID: 合约交易代码
    :param dataDate: 交易日期,格式为YYYYMM
    :param startTime: 分钟线起始时间,格式为HH:MM,可空
    :param endTime: 分钟线截止时间,格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutBarHistOneDayOKEX.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutBarHistOneDayOKEXGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutBarHistOneDayOKEXGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volume', u'volumeCoin', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','barTime': 'str','volumeCoin': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutOrderHistOneDayBitMexGet(instrumentID, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约在历史某一日盘口信息，包含当前的委托价，委托量等信息
    
    :param instrumentID: 交易市场合约交易代码
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为1小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为1小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutOrderHistOneDayBitMex.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutOrderHistOneDayBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutOrderHistOneDayBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'bid', u'ask', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','dataTime': 'str','bid': 'str','ask': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTransHistOneDayBitMexGet(instrumentID, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约在历史某一日的逐笔成交数据，包含每笔成交的价格及成交量
    
    :param instrumentID: 交易市场合约交易代码
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTransHistOneDayBitMex.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTransHistOneDayBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTransHistOneDayBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'tradeID', u'side', u'price', u'volume', u'tickDirection', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','dataTime': 'str','tradeID': 'str','side': 'str','tickDirection': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutTickHistOneDayBitMexGet(instrumentID, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取BitMex某一期货合约在历史某一日Tick信息数据,包括开盘价、最高价、最低价、最新价等信息
    
    :param instrumentID: 交易市场合约交易代码
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 查询截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutTickHistOneDayBitMex.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutTickHistOneDayBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutTickHistOneDayBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'dataTime', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'lastVolume', u'volume', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','dataTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoFutBarHistOneDayBitMexGet(instrumentID, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取BitMex某一期货合约在历史某一日分钟线数据，包含开盘价、最高价、最低价、收盘价等信息
    
    :param instrumentID: 合约交易代码
    :param dataDate: 交易日期
    :param startTime: 查询起始时间,格式为HH:MM,可空
    :param endTime: 查询截止时间,格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoFutBarHistOneDayBitMex.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoFutBarHistOneDayBitMexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoFutBarHistOneDayBitMexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'lastVolume', u'volume', u'deal', u'vwap', u'LocalTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','barTime': 'str','LocalTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayHuobiproGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对在历史某一日的盘口数据，包括委买队列和委卖队列信息。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日期
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为1小时)
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为1小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayHuobipro.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataDate': 'str','dataTime': 'str','bid': 'str','ask': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayHuobiproGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对在历史某一日的逐笔成交数据，包含每笔成交的价格及成交量。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日期
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayHuobipro.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataDate': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayHuobiproGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取Huobipro某一货币对在历史某一日的Tick数据，包含开盘价、最高价、最低价、最新价等信息。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日期
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS(查询时间限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayHuobipro.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'currencyPair', u'side', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'lastVolume', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','currencyPair': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoBarHistOneDayHuobiproGet(currencyPair, dataDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取Huobipro某一货币对在历史某一日的分钟线数据,包括开盘价、最高价、最低价、收盘价等信息。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日期
    :param startTime: 起始时间,格式为HH:MM,可空
    :param endTime: 截止时间,格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoBarHistOneDayHuobipro.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoBarHistOneDayHuobiproGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoBarHistOneDayHuobiproGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'barTime', u'volume', u'deal', u'openPrice', u'closePrice', u'lowPrice', u'highPrice', u'value', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataDate': 'str','barTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTSnapshotZBGet(currencyPair, field = "", pandas = "1"):
    """
    获取ZB某一货币对当前盘口信息数据,包括委买队列和委卖队列数据。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTSnapshotZB.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTSnapshotZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTSnapshotZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTSnapshotZBGet(currencyPair, field = "", pandas = "1"):
    """
    获取ZB某一货币对最新成交信息数据，包含成交的价格及成交量。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTSnapshotZB.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTSnapshotZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTSnapshotZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTSnapshotZBGet(currencyPair, field = "", pandas = "1"):
    """
    获取ZB某一货币对最新Tick信息数据,包括开盘价、最高价、最低价、最新价等信息。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTSnapshotZB.csv?ispandas=1&') 
    requestString.append("currencyPair=")
    if hasattr(currencyPair,'__iter__') and not isinstance(currencyPair, str):
        if len(currencyPair) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currencyPair
            requestString.append(None)
        else:
            requestString.append(','.join(currencyPair))
    else:
        requestString.append(currencyPair)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTSnapshotZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTSnapshotZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'openPrice', u'high24h', u'low24h', u'lastPrice', u'volume24h', u'B1', u'S1', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderRTIntraDayZBGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取ZB某一货币对在当日内的盘口数据,包括当日内的委买队列和委卖队列数据。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderRTIntraDayZB.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderRTIntraDayZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderRTIntraDayZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransRTIntraDayZBGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取ZB某一货币对在当日内的逐笔成交数据，包含每笔成交的价格及成交量。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransRTIntraDayZB.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransRTIntraDayZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransRTIntraDayZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickRTIntraDayZBGet(currencyPair, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取ZB某一货币对在当日内的Tick数据，包含开盘价、最高价、最低价、最新价等信息。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS,可空
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickRTIntraDayZB.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickRTIntraDayZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickRTIntraDayZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'openPrice', u'high24h', u'low24h', u'lastPrice', u'volume24h', u'B1', u'S1', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOrderHistOneDayZBGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取ZB某一货币对在历史某天的盘口数据,包括委买队列和委卖队列数据。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日起，格式为YYYYMMDD
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS(查询时间段限制为3小时)
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS(查询时间段限制为3小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOrderHistOneDayZB.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOrderHistOneDayZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOrderHistOneDayZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'bid', u'ask', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','bid': 'str','ask': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTransHistOneDayZBGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取ZB某一货币对在历史某天的逐笔成交数据，包含每笔成交的价格及成交量。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日起，格式为YYYYMMDD
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS(查询时间段限制为6小时)
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS(查询时间段限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTransHistOneDayZB.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTransHistOneDayZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTransHistOneDayZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'side', u'price', u'volume', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','side': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoTickHistOneDayZBGet(currencyPair, dataDate, startTime, endTime, field = "", pandas = "1"):
    """
    获取ZB某一货币对在历史某天的Tick数据，包含开盘价、最高价、最低价、最新价等信息。
    
    :param currencyPair: 货币对代码，两个货币间以“|”分隔，如BTC|USDT
    :param dataDate: 交易日起，格式为YYYYMMDD
    :param startTime: 起始时间,格式为HH:MM:SS.MSMSMS(查询时间段限制为6小时)
    :param endTime: 截止时间,格式为HH:MM:SS.MSMSMS(查询时间段限制为6小时)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoTickHistOneDayZB.csv?ispandas=1&') 
    if not isinstance(currencyPair, str) and not isinstance(currencyPair, unicode):
        currencyPair = str(currencyPair)

    requestString.append("currencyPair=%s"%(currencyPair))
    if not isinstance(dataDate, str) and not isinstance(dataDate, unicode):
        dataDate = str(dataDate)

    requestString.append("&dataDate=%s"%(dataDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoTickHistOneDayZBGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoTickHistOneDayZBGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currencyPair', u'dataDate', u'dataTime', u'openPrice', u'high24h', u'low24h', u'lastPrice', u'volume24h', u'B1', u'S1', u'localTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'currencyPair': 'str','dataTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AllOptionsGet(field = "", pandas = "1"):
    """
    获取全部国内期权
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/options/getAllOptions.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AllOptionsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AllOptionsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'optID', u'ticker', u'exchangeCD', u'currencyCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','optID': 'str','ticker': 'str','exchangeCD': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def OptGet(secID = "", optID = "", ticker = "", varSecID = "", varticker = "", contractStatus = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取期权合约基本信息，包含合约编码，交易代码，交易市场，标的代码、行权价、合约类型、交易状态、挂牌日期、最后交易日等。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,可空
    :param optID: 合约编码，交易所唯一证券编码，目前只有上交所提供,可以是列表,可空
    :param ticker: 通用交易代码,可以是列表,可空
    :param varSecID: 标的对应通联证券编码,可以是列表,可空
    :param varticker: 标的对应通用交易代码,可以是列表,可空
    :param contractStatus: 合约状态编码，详见枚举值,可以是列表,可空
    :param exchangeCD: 通联编制的交易市场编码,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/options/getOpt.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&optID=")
    if hasattr(optID,'__iter__') and not isinstance(optID, str):
        if len(optID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = optID
            requestString.append(None)
        else:
            requestString.append(','.join(optID))
    else:
        requestString.append(optID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&varSecID=")
    if hasattr(varSecID,'__iter__') and not isinstance(varSecID, str):
        if len(varSecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = varSecID
            requestString.append(None)
        else:
            requestString.append(','.join(varSecID))
    else:
        requestString.append(varSecID)
    requestString.append("&varticker=")
    if hasattr(varticker,'__iter__') and not isinstance(varticker, str):
        if len(varticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = varticker
            requestString.append(None)
        else:
            requestString.append(','.join(varticker))
    else:
        requestString.append(varticker)
    requestString.append("&contractStatus=")
    if hasattr(contractStatus,'__iter__') and not isinstance(contractStatus, str):
        if len(contractStatus) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractStatus
            requestString.append(None)
        else:
            requestString.append(','.join(contractStatus))
    else:
        requestString.append(contractStatus)
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'OptGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'OptGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'optID', u'secShortName', u'tickerSymbol', u'exchangeCD', u'currencyCD', u'varSecID', u'varShortName', u'varTicker', u'varExchangeCD', u'varType', u'contractType', u'strikePrice', u'contMultNum', u'contractStatus', u'listDate', u'expYear', u'expMonth', u'expDate', u'lastTradeDate', u'exerDate', u'deliDate', u'delistDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','optID': 'str','secShortName': 'str','tickerSymbol': 'str','exchangeCD': 'str','currencyCD': 'str','varSecID': 'str','varShortName': 'str','varTicker': 'str','varExchangeCD': 'str','varType': 'str','contractType': 'str','contractStatus': 'str','expYear': 'str','expMonth': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def OptVarGet(secID = "", ticker = "", exchangeCD = "", contractType = "", exerType = "", field = "", pandas = "1"):
    """
    获取期权品种基本信息，包含标的代码、标的名称、行权价、合约类型、履约方式、交割方式、合约单位、挂牌日期、合约月份描述、最后交易日描述、交易时间描述、行权日描述、交易单位、最小变动价位等。
    
    :param secID: 标的内部编码，与DataAPI.OptGet表VAR_UNI_CODE字段关联可获取该品种对应的期权合约,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 标的交易代码，如:510050 上证50ETF,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 标的交易市场,如:XSHG 上海证券交易所。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param contractType: 合约类型:CO 认购期权；PO 认沽期权；CP 认购、认沽期权。对应DataAPI.SysCodeGet.codeTypeID=60102。,可以是列表,可空
    :param exerType: 期权履约方式:A 美式；E 欧式。对应DataAPI.SysCodeGet.codeTypeID=60104。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/options/getOptVar.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&contractType=")
    if hasattr(contractType,'__iter__') and not isinstance(contractType, str):
        if len(contractType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractType
            requestString.append(None)
        else:
            requestString.append(','.join(contractType))
    else:
        requestString.append(contractType)
    requestString.append("&exerType=")
    if hasattr(exerType,'__iter__') and not isinstance(exerType, str):
        if len(exerType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exerType
            requestString.append(None)
        else:
            requestString.append(','.join(exerType))
    else:
        requestString.append(exerType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'OptVarGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'OptVarGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'exchangeCD', u'effDate', u'contractType', u'exerType', u'contMultNum', u'expMonthDesc', u'tradeTimeDesc', u'exerTimeDesc', u'lastTdateDesc', u'expDateDesc', u'exerDateDesc', u'deliMethod', u'tradeCommiNum', u'tradeCommiUnit', u'tickNum', u'tickUnit', u'contUnit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str','contractType': 'str','exerType': 'str','expMonthDesc': 'str','tradeTimeDesc': 'str','exerTimeDesc': 'str','lastTdateDesc': 'str','expDateDesc': 'str','exerDateDesc': 'str','deliMethod': 'str','tradeCommiUnit': 'str','tickUnit': 'str','contUnit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def OptDpoGet(secID = "", optID = "", ticker = "", varSecID = "", varTicker = "", varType = "", beginDate = "", endDate = "", exerType = "", contractType = "", field = "", pandas = "1"):
    """
    获取期权合约每日涨幅上限价格、跌幅下限价格、单位保证金等相关信息。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param optID: 合约编码，交易所唯一证券编码,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param varSecID: 标的对应通联证券编码,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param varTicker: 标的对应通用交易代码,可以是列表,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param varType: 期权标的类型编码，详见枚举值,secID、optID、ticker、varSecID、varTicker、varType至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param exerType: 履约方式编码，详见枚举值,可以是列表,可空
    :param contractType: 认购认沽编码，详见枚举值,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/options/getOptDpo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&optID=")
    if hasattr(optID,'__iter__') and not isinstance(optID, str):
        if len(optID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = optID
            requestString.append(None)
        else:
            requestString.append(','.join(optID))
    else:
        requestString.append(optID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&varSecID=")
    if hasattr(varSecID,'__iter__') and not isinstance(varSecID, str):
        if len(varSecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = varSecID
            requestString.append(None)
        else:
            requestString.append(','.join(varSecID))
    else:
        requestString.append(varSecID)
    requestString.append("&varTicker=")
    if hasattr(varTicker,'__iter__') and not isinstance(varTicker, str):
        if len(varTicker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = varTicker
            requestString.append(None)
        else:
            requestString.append(','.join(varTicker))
    else:
        requestString.append(varTicker)
    if not isinstance(varType, str) and not isinstance(varType, unicode):
        varType = str(varType)

    requestString.append("&varType=%s"%(varType))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exerType=")
    if hasattr(exerType,'__iter__') and not isinstance(exerType, str):
        if len(exerType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exerType
            requestString.append(None)
        else:
            requestString.append(','.join(exerType))
    else:
        requestString.append(exerType)
    requestString.append("&contractType=")
    if hasattr(contractType,'__iter__') and not isinstance(contractType, str):
        if len(contractType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = contractType
            requestString.append(None)
        else:
            requestString.append(','.join(contractType))
    else:
        requestString.append(contractType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'OptDpoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'OptDpoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'secID', u'optID', u'secShortName', u'ticker', u'exchangeCD', u'varSecID', u'varName', u'varTicker', u'varExchangeCD', u'varType', u'exerType', u'contractType', u'contMultNum', u'strikePrice', u'listDate', u'lastTradeDate', u'exerDate', u'deliDate', u'expDate', u'contVersion', u'openInt', u'preClosePrice', u'preSettPrice', u'varpreClosePrice', u'isChgPctl', u'limitUpNum', u'limitDownNum', u'marginUnit', u'marginRatioP1', u'marginRatioP2', u'roundLot', u'lmtOrdMin', u'lmtOrdMax', u'mktOrdMin', u'mktOrdMax', u'tickNum', u'contractStatus']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','optID': 'str','secShortName': 'str','ticker': 'str','exchangeCD': 'str','varSecID': 'str','varName': 'str','varTicker': 'str','varExchangeCD': 'str','varType': 'str','exerType': 'str','contractType': 'str','contVersion': 'str','isChgPctl': 'str','contractStatus': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktOptUlHvGet(tradeDate = "", period = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取上交所50ETF期权标的历史波动率数据，包含5、10、30、60、90、120、180、250、500日历史波动率，期限以自然日计。
    
    :param tradeDate: 交易日期,可以是列表,tradeDate、period至少选择一个
    :param period: 历史波动率期限，可选值：5/10/30/60/90/120/180/250/500,tradeDate、period至少选择一个
    :param secID: 期权标的对应的通联证券编码，可使用DataAPI.SecIDGet获取,可空
    :param ticker: 期权标的对应的通用交易代码,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/options/getMktOptUlHv.csv?ispandas=1&') 
    requestString.append("tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    if not isinstance(period, str) and not isinstance(period, unicode):
        period = str(period)

    requestString.append("&period=%s"%(period))
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("&secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktOptUlHvGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktOptUlHvGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'isAdj', u'closePrice', u'period', u'HV']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def OptRiskIndGet(secID = "", ticker = "", optID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    上交所公布期权风险指标，Delta，Theta，Gamma，Vega，Rho分别表示标的证券价格、时间、Delta、波动率、利率等因素变化时期权合约的价格变化。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,可以是列表,secID、ticker、optID至少选择一个
    :param ticker: 通用交易代码,可以是列表,secID、ticker、optID至少选择一个
    :param optID: 合约编码，交易所唯一证券编码,可以是列表,secID、ticker、optID至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/options/getOptRiskInd.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&optID=")
    if hasattr(optID,'__iter__') and not isinstance(optID, str):
        if len(optID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = optID
            requestString.append(None)
        else:
            requestString.append(','.join(optID))
    else:
        requestString.append(optID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'OptRiskIndGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'OptRiskIndGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'optID', u'secShortName', u'exchangeCD', u'tradeDate', u'delta', u'theta', u'gamma', u'vega', u'rho']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','optID': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def OptExerGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取期权交收信息，目前仅涉及上交所50ETF期权月度交收情况，包含认购期权和认沽期权的行权数量。
    
    :param secID: 通联编制的证券编码，可使用DataAPI.SecIDGet获取,secID、ticker至少选择一个
    :param ticker: 通用交易代码,secID、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/options/getOptExer.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'OptExerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'OptExerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'exerDate', u'constractType', u'exerVol']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','constractType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __IdxCsiDivGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取中证指数除数信息，包括上证180、上证50、沪深300、中证500指数的每日除数信息，其他指数请联系获取。为保证指数的连续性，当样本股名单发生变化或样本股的股本结构发生变化或样本股的市值出现非交易因素的变动时，股票指数根据样本股维护规则，采用“除数修正法”修正原除数。
    
    :param secID: 通联编制的证券编码，可通过DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 指数通用代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/idx/getIdxCsiDiv.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__IdxCsiDivGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__IdxCsiDivGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'effDate', u'secShortName', u'ticker', u'divFactor']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __IdxWeightGet(secID = "", ticker = "", beginDate = "", dataType = "", endDate = "", effDate = "", field = "", pandas = "1"):
    """
    获取部分重要中证指数及国证指数的权重信息，国证指数提供计算指数所用参数，包括每日收盘价、总股本、计算用股本、权重因子、总市值、计算用市值、权重等。
    
    :param secID: 指数内部编码，可通过交易代码和证券类型在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 指数通用代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 开始日期，输入格式“YYYYMMDD”,可空
    :param dataType: 权重类型，1-当日收盘权重，2-次日开盘权重，默认为1。,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param effDate: 生效日期，请注意次日权重对应的日期为收盘当日，不是下一交易日,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/idx/getIdxWeight.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(dataType, str) and not isinstance(dataType, unicode):
        dataType = str(dataType)

    requestString.append("&dataType=%s"%(dataType))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        effDate = effDate.strftime('%Y%m%d')
    except:
        effDate = effDate.replace('-', '')
    requestString.append("&effDate=%s"%(effDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__IdxWeightGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__IdxWeightGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'effDate', u'secShortName', u'ticker', u'consID', u'consShortName', u'consTickerSymbol', u'consExchangeCD', u'dataType', u'closePrice', u'adOpenRefP', u'tShares', u'tradRatio', u'adShares', u'wFactor', u'tMktV', u'adMktV', u'weight']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','consID': 'str','consShortName': 'str','consTickerSymbol': 'str','consExchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __CSIIdxWeightGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取中证700、中证800的指数成份股权重。如需其他中证指数，请联系。
    
    :param secID: 指数的证券编码，可通过交易代码和证券类型在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 指数的通用代码,可以是列表,secID、ticker至少选择一个
    :param beginDate: 开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/idx/getCSIIdxWeight.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__CSIIdxWeightGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__CSIIdxWeightGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secShortName', u'ticker', u'consID', u'consShortName', u'consTickerSymbol', u'consExchangeCD', u'effDate', u'weight']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','consID': 'str','consShortName': 'str','consTickerSymbol': 'str','consExchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __IdxIndiGet(secInfoType, secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取指数指标信息，包含股票指数规模（成份股流通市值加权）、债券指数规模（成分券规模加权）。另外沪深300指数提供日度5/20/40/60/120/250个交易日的历史波动率及最大值、最小值、四分位数、中位数等统计值。
    
    :param secInfoType: 指标类型，波动率（日涨跌幅的标准方差）统计近N个交易日及相应的历史最高值、最低值、中位数、四分位数
    :param secID: 通联编制的证券编码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 指数的通用代码,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 交易日开始日期，格式为YYYYMMDD,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 交易日结束日期，格式为YYYYMMDD,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/idx/getIdxIndi.csv?ispandas=1&') 
    if not isinstance(secInfoType, str) and not isinstance(secInfoType, unicode):
        secInfoType = str(secInfoType)

    requestString.append("secInfoType=%s"%(secInfoType))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__IdxIndiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__IdxIndiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCD', u'tradeDate', u'secInfoType', u'value']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','secInfoType': 'str','value': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IdxGet(secID = "", ticker = "", indexGroup = "", consType = "", consMkt = "", returnType = "", indexTypeCD = "", porgFullName = "", secShortName = "", wMethodCD = "", pubName = "", industryID = "", sortID = "", field = "", pandas = "1"):
    """
    获取国内外指数的基本要素信息，包括指数名称、指数代码、发布机构、发布日期、基日、基点、指数系列、样本证券类型、样本交易市场、加权方式、指数类型等。
    
    :param secID: 通联编制的证券编码，可在DataAPI.SecIDGet获取到。,可以是列表,可空
    :param ticker: 指数通用代码,可以是列表,可空
    :param indexGroup: 指数系列代码，可选值请查看参数枚举值,可空
    :param consType: 样本的证券类型代码，可选值请查看参数枚举值,可空
    :param consMkt: 样本的交易市场代码，可选值请查看参数枚举值,可空
    :param returnType: 收益类型代码，可选值请查看参数枚举值,可空
    :param indexTypeCD: 指数类型代码，可选值请查看参数枚举值,可空
    :param porgFullName: 发布机构全称，可模糊搜索,可空
    :param secShortName: 指数简称，可模糊搜索,可空
    :param wMethodCD: 指数的加权方式编码，可选值请查看参数枚举值,可空
    :param pubName: 指数编制机构名称，以沪深300为例发布机构为上交所，编制机构为中证指数,可空
    :param industryID: 行业指数对应的通联行业编码，对应getIndustry.industryID,可空
    :param sortID: 通联编制的指数分类编码，对应getSecType.typeID,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/idx/getIdx.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(indexGroup, str) and not isinstance(indexGroup, unicode):
        indexGroup = str(indexGroup)

    requestString.append("&indexGroup=%s"%(indexGroup))
    if not isinstance(consType, str) and not isinstance(consType, unicode):
        consType = str(consType)

    requestString.append("&consType=%s"%(consType))
    if not isinstance(consMkt, str) and not isinstance(consMkt, unicode):
        consMkt = str(consMkt)

    requestString.append("&consMkt=%s"%(consMkt))
    if not isinstance(returnType, str) and not isinstance(returnType, unicode):
        returnType = str(returnType)

    requestString.append("&returnType=%s"%(returnType))
    if not isinstance(indexTypeCD, str) and not isinstance(indexTypeCD, unicode):
        indexTypeCD = str(indexTypeCD)

    requestString.append("&indexTypeCD=%s"%(indexTypeCD))
    if not isinstance(porgFullName, str) and not isinstance(porgFullName, unicode):
        porgFullName = str(porgFullName)

    requestString.append("&porgFullName=%s"%(porgFullName))
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    if not isinstance(wMethodCD, str) and not isinstance(wMethodCD, unicode):
        wMethodCD = str(wMethodCD)

    requestString.append("&wMethodCD=%s"%(wMethodCD))
    if not isinstance(pubName, str) and not isinstance(pubName, unicode):
        pubName = str(pubName)

    requestString.append("&pubName=%s"%(pubName))
    if not isinstance(industryID, str) and not isinstance(industryID, unicode):
        industryID = str(industryID)

    requestString.append("&industryID=%s"%(industryID))
    if not isinstance(sortID, str) and not isinstance(sortID, unicode):
        sortID = str(sortID)

    requestString.append("&sortID=%s"%(sortID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IdxGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IdxGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'publishDate', u'secShortName', u'ticker', u'indexTypeCD', u'indexType', u'pubOrgCD', u'porgFullName', u'baseDate', u'basePoint', u'endDate', u'indexGroup', u'consType', u'consMkt', u'returnType', u'wMethodCD', u'updateTime', u'pubName', u'industryID', u'industryName', u'sortID', u'sortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','indexTypeCD': 'str','indexType': 'str','porgFullName': 'str','indexGroup': 'str','consType': 'str','consMkt': 'str','returnType': 'str','wMethodCD': 'str','pubName': 'str','industryID': 'str','industryName': 'str','sortID': 'str','sortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IdxConsGet(secID = "", ticker = "", isNew = "", intoDate = "", field = "", pandas = "1"):
    """
    获取指数的成分构成情况，包括指数成分股名称、成分股代码、入选日期、剔除日期等。
    
    :param secID: 通联编制的证券编码，可通过DataAPI.SecIDGet获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 指数通用代码,可以是列表,secID、ticker至少选择一个
    :param isNew: 是否最新成分,可以是列表,可空
    :param intoDate: 输入日期，可以获取这一天指数的成分信息，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/idx/getIdxCons.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    try:
        intoDate = intoDate.strftime('%Y%m%d')
    except:
        intoDate = intoDate.replace('-', '')
    requestString.append("&intoDate=%s"%(intoDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IdxConsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IdxConsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'intoDate', u'secShortName', u'ticker', u'consID', u'consShortName', u'consTickerSymbol', u'consExchangeCD', u'outDate', u'isNew']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','consID': 'str','consShortName': 'str','consTickerSymbol': 'str','consExchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IdxCloseWeightGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取指数成分股权重，包括成分股名称、成分股代码、权重生效日、成分股权重等。其中，中债指数按日更新，上证、中证、深证、国证等股票指数按月更新。
    
    :param secID: 通联编制的证券编码,secID、ticker至少选择一个
    :param ticker: 指数通用代码，当前提供的指数范围：中债系列全价指数,000001-上证综指,000002-上证A股,000003-上证B股,000004-上证工业,000005-上证商业,000006-上证地产,000007-上证公用,000008-上证综合,000009-上证380,000010-上证180,000011-上证基金,000012-上证国债,000013-上证企债,000015-上证红利,000016-上证50,000020-上证中型企业,000090-上证流通,000132-上证100,000133-上证150,000300-沪深300,000852-中证1000,000902-中证流通,000903-中证100,000904-中证200,000905-中证500,000906-中证800,000907-中证700,000922-中证红利,399001-深证成指,399002-深证深成指R,399004-深证100R,399005-深证中小板指,399006-创业板指,399007-深证300,399008-中小300,399009-深证200,399010-深证700,399011-深证1000,399012-深证创业300,399013-深市精选,399015-深证中小创新,399107-深证A指,399108-深证B指,399301-深信用债,399302-深公司债,399306-深证ETF,399307-深证转债,399324-深证红利,399330-深证100,399333-深证中小板R,399400-巨潮大中盘,399401-巨潮中小盘,399649-深证中小红利,DY1101-通联市场综合,DY1102-通联阳光私募,DY1201-通联股票策略,DY1202-通联事件驱动,DY1203-通联管理期货,DY1204-通联相对价值,DY1205-通联债券策略,DY1206-通联宏观策略,DY1207-通联复合策略,DY1208-通联FOF/MOM,DY1301-通联股票量化,DY1302-通联股票多头,DY1303-通联股票多空,DY1304-通联组合投资,DY1305-通联期货量化,DY1306-通联期货主动,DY1307-通联市场中性,DY2201-通联股票多头,DY2202-通联管理期货,DY2203-通联相对价值,DY2204-通联债券策略,secID、ticker至少选择一个
    :param beginDate: 起始生效日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止生效日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/idx/getIdxCloseWeight.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IdxCloseWeightGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IdxCloseWeightGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'effDate', u'secShortName', u'ticker', u'consID', u'consShortName', u'consTickerSymbol', u'consExchangeCD', u'weight']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','consID': 'str','consShortName': 'str','consTickerSymbol': 'str','consExchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def mIdxCloseWeightGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取月度指数成分股权重，获取信息包括成分股名称、成分股代码、权重生效日、成分股权重等。
    
    :param secID: 指数的证券编码， 可通过指数代码和证券类型（assetClass=IDX）在DataAPI.SecIDGet获取,secID、ticker至少选择一个
    :param ticker: 指数通用代码，当前提供的指数范围：中债系列全价指数,000001-上证综指,000002-上证A股,000003-上证B股,000004-上证工业,000005-上证商业,000006-上证地产,000007-上证公用,000008-上证综合,000009-上证380,000010-上证180,000011-上证基金,000012-上证国债,000013-上证企债,000015-上证红利,000016-上证50,000020-上证中型企业,000090-上证流通,000132-上证100,000133-上证150,000300-沪深300,000852-中证1000,000902-中证流通,000903-中证100,000904-中证200,000905-中证500,000906-中证800,000907-中证700,000922-中证红利,399001-深证成指,399002-深证深成指R,399004-深证100R,399005-深证中小板指,399006-创业板指,399007-深证300,399008-中小300,399009-深证200,399010-深证700,399011-深证1000,399012-深证创业300,399013-深市精选,399015-深证中小创新,399107-深证A指,399108-深证B指,399301-深信用债,399302-深公司债,399306-深证ETF,399307-深证转债,399324-深证红利,399330-深证100,399333-深证中小板R,399400-巨潮大中盘,399401-巨潮中小盘,399649-深证中小红利,DY1101-通联市场综合,DY1102-通联阳光私募,DY1201-通联股票策略,DY1202-通联事件驱动,DY1203-通联管理期货,DY1204-通联相对价值,DY1205-通联债券策略,DY1206-通联宏观策略,DY1207-通联复合策略,DY1208-通联FOF/MOM,DY1301-通联股票量化,DY1302-通联股票多头,DY1303-通联股票多空,DY1304-通联组合投资,DY1305-通联期货量化,DY1306-通联期货主动,DY1307-通联市场中性,DY2201-通联股票多头,DY2202-通联管理期货,DY2203-通联相对价值,DY2204-通联债券策略,secID、ticker至少选择一个
    :param beginDate: 权重生效起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 权重生效截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/idx/getmIdxCloseWeight.csv?ispandas=1&') 
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'mIdxCloseWeightGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'mIdxCloseWeightGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'effDate', u'secShortName', u'ticker', u'consID', u'consShortName', u'consTickerSymbol', u'consExchangeCD', u'weight']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secShortName': 'str','ticker': 'str','consID': 'str','consShortName': 'str','consTickerSymbol': 'str','consExchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundPerfIndicGet(dataDate, window, secID = "", ticker = "", secIDInt = "", field = "", pandas = "1"):
    """
    获取私募基金净值性能指标，包含收益和风险类别指标，如年化收益、年化风险、夏普比率、最大回撤、信息比率等157个指标，8个时间维度的数据（不包含货币基金）。
    
    :param dataDate: 输入一个日期，输入格式“YYYYMMDD”
    :param window: 性能指标计算时间窗口长度,1-近一个月;2-近三个月;3-近半年;4-年初至今;5-近一年;6-近两年;7-近三年;8-成立以来;,可以是列表
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、secIDInt至少选择一个
    :param ticker: 输入一个或多个基金代码，用\\\",可以是列表,secID、ticker、secIDInt至少选择一个
    :param secIDInt: 私募基金内部整型编码,可以是列表,secID、ticker、secIDInt至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundPerfIndic.csv?ispandas=1&') 
    try:
        dataDate = dataDate.strftime('%Y%m%d')
    except:
        dataDate = dataDate.replace('-', '')
    requestString.append("dataDate=%s"%(dataDate))
    requestString.append("&window=")
    if hasattr(window,'__iter__') and not isinstance(window, str):
        if len(window) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = window
            requestString.append(None)
        else:
            requestString.append(','.join(window))
    else:
        requestString.append(window)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&secIDInt=")
    if hasattr(secIDInt,'__iter__') and not isinstance(secIDInt, str):
        if len(secIDInt) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secIDInt
            requestString.append(None)
        else:
            requestString.append(','.join(secIDInt))
    else:
        requestString.append(secIDInt)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundPerfIndicGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundPerfIndicGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secIDInt', u'ticker', u'secShortName', u'window', u'endDate', u'annTotReturn', u'annTotRisk', u'annActReturn', u'annActRisk', u'deannActReturn', u'deannActRisk', u'maxDD', u'downSideRisk', u'IR', u'sharpeRatio', u'maxDDRecDays', u'corrEquity', u'corrBond', u'corrFuture', u'maxContRiseDays', u'maxContDeclDays', u'maxContRiseRate', u'maxContDeclRate', u'maxDRisingRate', u'maxDDeclineRate', u'maxRiseBegDate', u'maxRiseEndDate', u'maxDeclBegDate', u'maxDeclEndDate', u'lossDaysRate', u'profitDaysRate', u'HURST', u'STUTZER', u'TREYNOR', u'SORTINO', u'realizedAlpha', u'realizedBeta', u'residualRisk', u'mSquare', u'adjSharpRatio', u'var950', u'erVar950', u'cvar950', u'csr950', u'var975', u'erVar975', u'cvar975', u'csr975', u'var990', u'erVar990', u'cvar990', u'csr990', u'SKEWNESS', u'KURTOSIS', u'JENSENS', u'CALMAR', u'STEARLING', u'BURKE', u'OMEGA', u'KAPPA3', u'MAR', u'RAR', u'rCubed', u'trackingError', u'rSquare', u'upCaptReturn', u'upCaptRate', u'downCaptReturn', u'downCaptRate', u'secMDD', u'secMDDPeriods', u'secMDDRecovery', u'thirdMDD', u'thirdMDDPeriods', u'thirdMDDRecovery', u'weekAutoCorr', u'bullBeta', u'bearBeta', u'timingTM', u'selectionTM', u'timingCL', u'selectionCL', u'timingHM', u'selectionHM', u'alphaCoef', u'isNavQualified', u'dMaxDDRecPeriods', u'dMaxContRiseRate', u'dMaxContRisePeriods', u'dMaxPeriodRiseRate', u'dMaxRiseBegDate', u'dMaxRiseEndDate', u'dMaxContDeclRate', u'dMaxContDeclPeriods', u'dMaxPeriodDeclRate', u'dMaxDeclBegDate', u'dMaxDeclEndDate', u'dProfPeriodRate', u'dLossPeriodRate', u'wMaxDdRecPeriods', u'wMaxContRiseRate', u'wMaxContRisePeriods', u'wMaxPeriodRiseRate', u'wMaxRiseBegDate', u'wMaxRiseEndDate', u'wMaxContDeclRate', u'wMaxContDeclPeriods', u'wMaxPeriodDeclRate', u'wMaxDeclBegDate', u'wMaxDeclEndDate', u'wProfPeriodRate', u'wLossPeriodRate', u'mMaxDDRecPeriods', u'mMaxContRiseRate', u'mMaxContRisePeriods', u'mMaxPeriodRiseRate', u'mMaxRiseBegDate', u'mMaxRiseEndDate', u'mMaxContDeclRate', u'mMaxContDeclPeriods', u'mMaxPeriodDeclRate', u'mMaxDeclBegDate', u'mMaxDeclEndDate', u'mProfPeriodRate', u'mLossPeriodRate', u'qMaxDDRecPeriods', u'qMaxContRiseRate', u'qMaxContRisePeriods', u'qMaxPeriodRiseRate', u'qMaxRiseBegDate', u'qMaxRiseEndDate', u'qMaxContDeclRate', u'qMaxContDeclPeriods', u'qMaxPeriodDeclRate', u'qMaxDeclBegDate', u'qMaxDeclEndDate', u'qProfPeriodRate', u'qLossPeriodRate', u'sMaxDDRecPeriods', u'sMaxPeriodRiseRate', u'sMaxContRisePeriods', u'sMaxContRiseRate', u'sMaxRiseBegDate', u'sMaxRiseEndDate', u'sMaxPeriodDeclRate', u'sMaxContDeclPeriods', u'sMaxContDeclRate', u'sMaxDeclBegDate', u'sMaxDeclEndDate', u'sProfPeriodRate', u'sLossPeriodRate', u'yMaxDDRecPeriods', u'yMaxPeriodRiseRate', u'yMaxContRisePeriods', u'yMaxContRiseRate', u'yMaxRiseBegDate', u'yMaxRiseEndDate', u'yMaxPeriodDeclRate', u'yMaxContDeclPeriods', u'yMaxContDeclRate', u'yProfPeriodRate', u'yLosyPeriodRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundResumeGet(personID = "", name = "", partyID = "", partyFullName = "", field = "", pandas = "1"):
    """
    获取私募高管人员任职经历信息。
    
    :param personID: 人物ID,可以是列表,personID、name、partyID、partyFullName至少选择一个
    :param name: 人物名称,personID、name、partyID、partyFullName至少选择一个
    :param partyID: 公司ID,可以是列表,personID、name、partyID、partyFullName至少选择一个
    :param partyFullName: 历任公司全称,personID、name、partyID、partyFullName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundResume.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    if not isinstance(partyFullName, str) and not isinstance(partyFullName, unicode):
        partyFullName = str(partyFullName)

    requestString.append("&partyFullName=%s"%(partyFullName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundResumeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundResumeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'acceYear', u'acceMonth', u'dimiYear', u'dimiMonth', u'partyID', u'partyFullName', u'position', u'isIncumbent']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','acceYear': 'str','acceMonth': 'str','dimiYear': 'str','dimiMonth': 'str','partyFullName': 'str','position': 'str','isIncumbent': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundNavGet(secID = "", secFullName = "", secIDInt = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    获取私募基金净值、累计净值数据
    
    :param secID: 私募基金内部编码,可通过私募基金基本信息表getPfund获取,可以是列表,secID、secFullName、secIDInt至少选择一个
    :param secFullName: 私募基金全称,secID、secFullName、secIDInt至少选择一个
    :param secIDInt: 私募基金内部整型编码,可通过私募基金基本信息表getPfund获取,可以是列表,secID、secFullName、secIDInt至少选择一个
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param beginDate: 开始日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundNav.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    if not isinstance(secFullName, str) and not isinstance(secFullName, unicode):
        secFullName = str(secFullName)

    requestString.append("&secFullName=%s"%(secFullName))
    requestString.append("&secIDInt=")
    if hasattr(secIDInt,'__iter__') and not isinstance(secIDInt, str):
        if len(secIDInt) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secIDInt
            requestString.append(None)
        else:
            requestString.append(','.join(secIDInt))
    else:
        requestString.append(secIDInt)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundNavGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundNavGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secIDInt', u'secFullName', u'endDate', u'nav', u'accumNav', u'adjNav', u'navUnit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundGet(secID = "", secIDInt = "", secFullName = "", pfStyleCD = "", statusCD = "", invStgyCD = "", invConCD = "", amacFullNameCN = "", partyRegCD = "", mainFundTypeCD = "", partyStatusCD = "", instType = "", amacInstID = "", recordStatusCD = "", partyRcDateBEG = "", partyRcDateEND = "", field = "", pandas = "1"):
    """
    获取私募基本信息
    
    :param secID: 私募基金内部编码,可通过私募基金基本信息表getPfund获取,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param secIDInt: 私募基金内部整型编码,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param secFullName: 私募基金全称,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param pfStyleCD: 产品类型，1-私募证券投资基金；2-有限合伙等。对应DataAPI.SysCodeGet.codeTypeID=40031。,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param statusCD: 运行状态，100-正常；202-到期清算等。对应DataAPI.SysCodeGet.codeTypeID=40034。,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param invStgyCD: 投资策略，1-股票策略；2-相对价值等。对应DataAPI.SysCodeGet.codeTypeID=40032。,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param invConCD: 投资顾问内部ID,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param amacFullNameCN: 对应基金业协会的基金管理人全称(中文)，支持模糊查询,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param partyRegCD: 基金管理人备案编码,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param mainFundTypeCD: 管理基金主要类别编码,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param partyStatusCD: 基金管理人备案状态编码，0-已撤销，1-在备案，2-未备案,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param instType: 对应基金业协会的协会机构类型，主要类型为：私募证券投资基金管理人，私募资产配置类管理人，私募股权、创业投资基金管理人，其他私募投资基金管理人,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param amacInstID: 基金管理人公示编码，对应协会URL上的编码,可以是列表,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param recordStatusCD: 产品备案状态编码，0-已撤销，1-在备案，2-未备案,secID、secIDInt、secFullName、pfStyleCD、statusCD、invStgyCD、invConCD、amacFullNameCN、partyRegCD、mainFundTypeCD、partyStatusCD、instType、amacInstID、recordStatusCD至少选择一个
    :param partyRcDateBEG: 基金管理人登记开始日期，输入一个日期，‘yyyymmdd’，返回在这个日期之后备案的管理人,可空
    :param partyRcDateEND: 基金管理人登记截止日期，输入一个日期，‘yyyymmdd’，返回在这个日期之前备案的管理人,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfund.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&secIDInt=")
    if hasattr(secIDInt,'__iter__') and not isinstance(secIDInt, str):
        if len(secIDInt) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secIDInt
            requestString.append(None)
        else:
            requestString.append(','.join(secIDInt))
    else:
        requestString.append(secIDInt)
    if not isinstance(secFullName, str) and not isinstance(secFullName, unicode):
        secFullName = str(secFullName)

    requestString.append("&secFullName=%s"%(secFullName))
    requestString.append("&pfStyleCD=")
    if hasattr(pfStyleCD,'__iter__') and not isinstance(pfStyleCD, str):
        if len(pfStyleCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = pfStyleCD
            requestString.append(None)
        else:
            requestString.append(','.join(pfStyleCD))
    else:
        requestString.append(pfStyleCD)
    requestString.append("&statusCD=")
    if hasattr(statusCD,'__iter__') and not isinstance(statusCD, str):
        if len(statusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statusCD
            requestString.append(None)
        else:
            requestString.append(','.join(statusCD))
    else:
        requestString.append(statusCD)
    requestString.append("&invStgyCD=")
    if hasattr(invStgyCD,'__iter__') and not isinstance(invStgyCD, str):
        if len(invStgyCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = invStgyCD
            requestString.append(None)
        else:
            requestString.append(','.join(invStgyCD))
    else:
        requestString.append(invStgyCD)
    requestString.append("&invConCD=")
    if hasattr(invConCD,'__iter__') and not isinstance(invConCD, str):
        if len(invConCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = invConCD
            requestString.append(None)
        else:
            requestString.append(','.join(invConCD))
    else:
        requestString.append(invConCD)
    if not isinstance(amacFullNameCN, str) and not isinstance(amacFullNameCN, unicode):
        amacFullNameCN = str(amacFullNameCN)

    requestString.append("&amacFullNameCN=%s"%(amacFullNameCN))
    requestString.append("&partyRegCD=")
    if hasattr(partyRegCD,'__iter__') and not isinstance(partyRegCD, str):
        if len(partyRegCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyRegCD
            requestString.append(None)
        else:
            requestString.append(','.join(partyRegCD))
    else:
        requestString.append(partyRegCD)
    requestString.append("&mainFundTypeCD=")
    if hasattr(mainFundTypeCD,'__iter__') and not isinstance(mainFundTypeCD, str):
        if len(mainFundTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = mainFundTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(mainFundTypeCD))
    else:
        requestString.append(mainFundTypeCD)
    requestString.append("&partyStatusCD=")
    if hasattr(partyStatusCD,'__iter__') and not isinstance(partyStatusCD, str):
        if len(partyStatusCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyStatusCD
            requestString.append(None)
        else:
            requestString.append(','.join(partyStatusCD))
    else:
        requestString.append(partyStatusCD)
    if not isinstance(instType, str) and not isinstance(instType, unicode):
        instType = str(instType)

    requestString.append("&instType=%s"%(instType))
    requestString.append("&amacInstID=")
    if hasattr(amacInstID,'__iter__') and not isinstance(amacInstID, str):
        if len(amacInstID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = amacInstID
            requestString.append(None)
        else:
            requestString.append(','.join(amacInstID))
    else:
        requestString.append(amacInstID)
    if not isinstance(recordStatusCD, str) and not isinstance(recordStatusCD, unicode):
        recordStatusCD = str(recordStatusCD)

    requestString.append("&recordStatusCD=%s"%(recordStatusCD))
    try:
        partyRcDateBEG = partyRcDateBEG.strftime('%Y%m%d')
    except:
        partyRcDateBEG = partyRcDateBEG.replace('-', '')
    requestString.append("&partyRcDateBEG=%s"%(partyRcDateBEG))
    try:
        partyRcDateEND = partyRcDateEND.strftime('%Y%m%d')
    except:
        partyRcDateEND = partyRcDateEND.replace('-', '')
    requestString.append("&partyRcDateEND=%s"%(partyRcDateEND))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'secIDInt', u'secFullName', u'establishDate', u'pfStyleCD', u'pfStyle', u'statusCD', u'status', u'invStgyCD', u'invStgy', u'invStgyChildCD', u'invStgyChild', u'duration', u'openDateDesc', u'invConCD', u'partyFullName', u'custodian', u'issuePlatform', u'tradingBroker', u'subStartPoint', u'scaleInitial', u'closingDura', u'issueFee', u'redeemFee', u'manaFee', u'perfReturn', u'recordCD', u'revealTag', u'amacFullNameCN', u'amacFullNameEN', u'amacInstID', u'instType', u'mainFundType', u'mainFundTypeCD', u'partyRecordDate', u'partyRegCD', u'partyStatus', u'partyStatusCD', u'recordDate', u'recordStatus', u'recordStatusCD', u'serviceType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secFullName': 'str','pfStyleCD': 'str','pfStyle': 'str','statusCD': 'str','status': 'str','invStgyCD': 'str','invStgy': 'str','invStgyChildCD': 'str','invStgyChild': 'str','openDateDesc': 'str','partyFullName': 'str','custodian': 'str','issuePlatform': 'str','tradingBroker': 'str','closingDura': 'str','recordCD': 'str','revealTag': 'str','amacFullNameCN': 'str','amacFullNameEN': 'str','amacInstID': 'str','instType': 'str','mainFundType': 'str','mainFundTypeCD': 'str','partyRegCD': 'str','partyStatus': 'str','recordStatus': 'str','recordStatusCD': 'str','serviceType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundInstManagerGet(personID = "", partyID = "", name = "", partyFullName = "", field = "", pandas = "1"):
    """
    获取投顾管理层
    
    :param personID: 人员内部编码,可以是列表,personID、partyID至少选择一个
    :param partyID: 机构id,可以是列表,personID、partyID至少选择一个
    :param name: 姓名,可空
    :param partyFullName: 机构全称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundInstManager.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    if not isinstance(partyFullName, str) and not isinstance(partyFullName, unicode):
        partyFullName = str(partyFullName)

    requestString.append("&partyFullName=%s"%(partyFullName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundInstManagerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundInstManagerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'position', u'beginDate', u'endDate', u'backgroundDesc', u'background', u'isMana', u'partyID', u'partyFullName', u'partyShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','position': 'str','backgroundDesc': 'str','background': 'str','partyFullName': 'str','partyShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundManagerGet(personID = "", name = "", secIDInt = "", secID = "", field = "", pandas = "1"):
    """
    获取私募基金经理
    
    :param personID: 人员内部编码,可以是列表,personID、name、secIDInt、secID至少选择一个
    :param name: 姓名,personID、name、secIDInt、secID至少选择一个
    :param secIDInt: 内部编码(整型),可以是列表,personID、name、secIDInt、secID至少选择一个
    :param secID: 内部编码,可以是列表,personID、name、secIDInt、secID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundManager.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    requestString.append("&secIDInt=")
    if hasattr(secIDInt,'__iter__') and not isinstance(secIDInt, str):
        if len(secIDInt) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secIDInt
            requestString.append(None)
        else:
            requestString.append(','.join(secIDInt))
    else:
        requestString.append(secIDInt)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundManagerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundManagerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'secIDInt', u'secID', u'secFullName', u'secShortName', u'isIncumbent', u'accessionDate', u'dimissionDate', u'partyId', u'partyFullName', u'partyShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','secID': 'str','secFullName': 'str','secShortName': 'str','partyFullName': 'str','partyShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundManReturnGet(personID = "", secIDInt = "", secID = "", beginDate = "", name = "", endDate = "", field = "", pandas = "1"):
    """
    获取基金经理任期回报
    
    :param personID: 人员内部编码,可以是列表,personID、secIDInt、secID、beginDate至少选择一个
    :param secIDInt: 内部编码(整型),可以是列表,personID、secIDInt、secID、beginDate至少选择一个
    :param secID: 内部编码,可以是列表,personID、secIDInt、secID、beginDate至少选择一个
    :param beginDate: 起始数据日期，输入格式“YYYYMMDD”,personID、secIDInt、secID、beginDate至少选择一个
    :param name: 姓名,可空
    :param endDate: 截止数据日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundManReturn.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    requestString.append("&secIDInt=")
    if hasattr(secIDInt,'__iter__') and not isinstance(secIDInt, str):
        if len(secIDInt) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secIDInt
            requestString.append(None)
        else:
            requestString.append(','.join(secIDInt))
    else:
        requestString.append(secIDInt)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundManReturnGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundManReturnGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'secIDInt', u'secID', u'secFullName', u'secShortName', u'endDate', u'workingDay', u'returnMan', u'returnManA']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','secID': 'str','secFullName': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundManagerRepGet(personID = "", name = "", field = "", pandas = "1"):
    """
    获取基金经理代表产品
    
    :param personID: 人员内部编码,可以是列表,personID、name至少选择一个
    :param name: 姓名,personID、name至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundManagerRep.csv?ispandas=1&') 
    requestString.append("personID=")
    if hasattr(personID,'__iter__') and not isinstance(personID, str):
        if len(personID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = personID
            requestString.append(None)
        else:
            requestString.append(','.join(personID))
    else:
        requestString.append(personID)
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundManagerRepGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundManagerRepGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'personID', u'name', u'secIDInt', u'secID', u'secFullName', u'secShortName', u'numAll', u'numDura']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','secID': 'str','secFullName': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundNavReturnGet(secIDInt = "", secID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取私募基金收益
    
    :param secIDInt: 内部编码(整型),可以是列表,secIDInt、secID、beginDate至少选择一个
    :param secID: 内部编码,可以是列表,secIDInt、secID、beginDate至少选择一个
    :param beginDate: 数据日期,secIDInt、secID、beginDate至少选择一个
    :param endDate: 数据日期,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundNavReturn.csv?ispandas=1&') 
    requestString.append("secIDInt=")
    if hasattr(secIDInt,'__iter__') and not isinstance(secIDInt, str):
        if len(secIDInt) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secIDInt
            requestString.append(None)
        else:
            requestString.append(','.join(secIDInt))
    else:
        requestString.append(secIDInt)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&endDate=")
    if hasattr(endDate,'__iter__') and not isinstance(endDate, str):
        if len(endDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = endDate
            requestString.append(None)
        else:
            requestString.append(','.join(endDate))
    else:
        requestString.append(endDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundNavReturnGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundNavReturnGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secIDInt', u'secID', u'secFullName', u'secShortName', u'endDate', u'returnAccum', u'returnA']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','secFullName': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundInstRepGet(partyID = "", partyFullName = "", field = "", pandas = "1"):
    """
    获取投顾代表产品
    
    :param partyID: 机构id,可以是列表,partyID、partyFullName至少选择一个
    :param partyFullName: 机构全称,partyID、partyFullName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundInstRep.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    if not isinstance(partyFullName, str) and not isinstance(partyFullName, unicode):
        partyFullName = str(partyFullName)

    requestString.append("&partyFullName=%s"%(partyFullName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundInstRepGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundInstRepGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'partyFullName', u'partyShortName', u'secIDInt', u'secID', u'secFullName', u'secShortName', u'numAll', u'numDura']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyFullName': 'str','partyShortName': 'str','secID': 'str','secFullName': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def PfundInstInfoGet(partyID = "", beginDate = "", regCD = "", mainFundType = "", partyFullName = "", endDate = "", field = "", pandas = "1"):
    """
    获取投顾机构信息
    
    :param partyID: 机构id,可以是列表,partyID、beginDate、regCD、mainFundType至少选择一个
    :param beginDate: 起始备案日期，输入格式“YYYYMMDD”,partyID、beginDate、regCD、mainFundType至少选择一个
    :param regCD: 登记编码,可以是列表,partyID、beginDate、regCD、mainFundType至少选择一个
    :param mainFundType: 管理基金主要类别,可以是列表,partyID、beginDate、regCD、mainFundType至少选择一个
    :param partyFullName: 机构全称,可空
    :param endDate: 截止备案日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/pfund/getPfundInstInfo.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&regCD=")
    if hasattr(regCD,'__iter__') and not isinstance(regCD, str):
        if len(regCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = regCD
            requestString.append(None)
        else:
            requestString.append(','.join(regCD))
    else:
        requestString.append(regCD)
    requestString.append("&mainFundType=")
    if hasattr(mainFundType,'__iter__') and not isinstance(mainFundType, str):
        if len(mainFundType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = mainFundType
            requestString.append(None)
        else:
            requestString.append(','.join(mainFundType))
    else:
        requestString.append(mainFundType)
    if not isinstance(partyFullName, str) and not isinstance(partyFullName, unicode):
        partyFullName = str(partyFullName)

    requestString.append("&partyFullName=%s"%(partyFullName))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'PfundInstInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'PfundInstInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'partyFullName', u'partyShortName', u'profile', u'ideaStrategy', u'keyPerson', u'imageURL', u'recordDate', u'regCD', u'legalRep', u'isQualified', u'qualifyWay', u'empNum', u'mainFundType', u'privateIndScale', u'privateConScale', u'peScale', u'vcScale', u'otherScale']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyFullName': 'str','partyShortName': 'str','profile': 'str','ideaStrategy': 'str','keyPerson': 'str','imageURL': 'str','regCD': 'str','legalRep': 'str','qualifyWay': 'str','mainFundType': 'str','privateIndScale': 'str','privateConScale': 'str','peScale': 'str','vcScale': 'str','otherScale': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __GlobalMacroDataGet(indicID = "", indicName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含全球宏观20多个主要国家地区重要宏观指标数据，历史数据从1900年开始。具体指标请查询“全球宏观指标”API。
    
    :param indicID: 指标代码，全球宏观指标是以'G'开头的十位编码，输入一个或多个指标代码，查询相关指标信息，可多值输入。,可以是列表,indicID、indicName至少选择一个
    :param indicName: 指标中文全称，可模糊查询,indicID、indicName至少选择一个
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getGlobalMacroData.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(indicName, str) and not isinstance(indicName, unicode):
        indicName = str(indicName)

    requestString.append("&indicName=%s"%(indicName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__GlobalMacroDataGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__GlobalMacroDataGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'indicName', u'publishTime', u'periodDate', u'dataValue', u'unit', u'region', u'dataSource', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indicID': 'str','indicName': 'str','unit': 'str','region': 'str','dataSource': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __agriProdDailyAVGGet(beginDate = "", endDate = "", symbolDY = "", agriProdType = "", field = "", pandas = "1"):
    """
    查询获取全国农产品日度平均价
    
    :param beginDate: 查询开始日期，输入格式YYYYMMDD,beginDate、endDate、symbolDY、agriProdType至少选择一个
    :param endDate: 查询截止日期，输入格式YYYYMMDD,beginDate、endDate、symbolDY、agriProdType至少选择一个
    :param symbolDY: 可选农产品：DY1QXCP-羊肉，DY2QXCP-鸡蛋，DY3QXCP-牛肉，DY4QXCP-白条鸡，DY5QXCP-猪肉（白条猪)，DY1SCQ-活草鱼，DY2SCQ-大带鱼，DY3SCQ-活鲫鱼，DY4SCQ-活鲤鱼，DY5SCQ-白鲢活鱼，DY6SCQ-花鲢活鱼，DY1SC-白萝卜，DY2SC-葱头，DY3SC-冬瓜，DY4SC-豆角，DY5SC-胡萝卜，DY6SC-黄瓜，DY7SC-莲藕，DY8SC-南瓜，DY9SC-茄子，DY10SC-青椒，DY11SC-土豆，DY12SC-莴笋，DY13SC-西红柿，DY14SC-西葫芦，DY15SC-菠菜，DY16SC-大白菜，DY17SC-大葱，DY18SC-韭菜，DY19SC-芹菜，DY20SC-生菜，DY21SC-洋白菜，DY22SC-油菜，DY23SC-香菇，DY24SC-平菇，DY1GP-鸭梨，DY2GP-富士苹果，DY3GP-巨峰葡萄，DY4GP-香蕉，DY5GP-菠萝，DY6GP-西瓜，,可以是列表,beginDate、endDate、symbolDY、agriProdType至少选择一个
    :param agriProdType: 可选农产品类别：禽畜产品，水产品，蔬菜，果品,可以是列表,beginDate、endDate、symbolDY、agriProdType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getagriProdDailyAVG.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&symbolDY=")
    if hasattr(symbolDY,'__iter__') and not isinstance(symbolDY, str):
        if len(symbolDY) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = symbolDY
            requestString.append(None)
        else:
            requestString.append(','.join(symbolDY))
    else:
        requestString.append(symbolDY)
    requestString.append("&agriProdType=")
    if hasattr(agriProdType,'__iter__') and not isinstance(agriProdType, str):
        if len(agriProdType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = agriProdType
            requestString.append(None)
        else:
            requestString.append(','.join(agriProdType))
    else:
        requestString.append(agriProdType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__agriProdDailyAVGGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__agriProdDailyAVGGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'symbolDY', u'agriProdName', u'agriProdType', u'avgPrice', u'dataDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'symbolDY': 'str','agriProdName': 'str','agriProdType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __agriProdMonthlyAVGGet(month = "", symbolDY = "", agriProdType = "", field = "", pandas = "1"):
    """
    查询获取全国农产品月度平均价
    
    :param month: 查询月份，输入格式YYYYMM,month、symbolDY、agriProdType至少选择一个
    :param symbolDY: 可选农产品：DY1QXCP-羊肉，DY2QXCP-鸡蛋，DY3QXCP-牛肉，DY4QXCP-白条鸡，DY5QXCP-猪肉（白条猪)，DY1SCQ-活草鱼，DY2SCQ-大带鱼，DY3SCQ-活鲫鱼，DY4SCQ-活鲤鱼，DY5SCQ-白鲢活鱼，DY6SCQ-花鲢活鱼，DY1SC-白萝卜，DY2SC-葱头，DY3SC-冬瓜，DY4SC-豆角，DY5SC-胡萝卜，DY6SC-黄瓜，DY7SC-莲藕，DY8SC-南瓜，DY9SC-茄子，DY10SC-青椒，DY11SC-土豆，DY12SC-莴笋，DY13SC-西红柿，DY14SC-西葫芦，DY15SC-菠菜，DY16SC-大白菜，DY17SC-大葱，DY18SC-韭菜，DY19SC-芹菜，DY20SC-生菜，DY21SC-洋白菜，DY22SC-油菜，DY23SC-香菇，DY24SC-平菇，DY1GP-鸭梨，DY2GP-富士苹果，DY3GP-巨峰葡萄，DY4GP-香蕉，DY5GP-菠萝，DY6GP-西瓜，,可以是列表,month、symbolDY、agriProdType至少选择一个
    :param agriProdType: 可选农产品类别：禽畜产品，水产品，蔬菜，果品,可以是列表,month、symbolDY、agriProdType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getagriProdMonthlyAVG.csv?ispandas=1&') 
    if not isinstance(month, str) and not isinstance(month, unicode):
        month = str(month)

    requestString.append("month=%s"%(month))
    requestString.append("&symbolDY=")
    if hasattr(symbolDY,'__iter__') and not isinstance(symbolDY, str):
        if len(symbolDY) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = symbolDY
            requestString.append(None)
        else:
            requestString.append(','.join(symbolDY))
    else:
        requestString.append(symbolDY)
    requestString.append("&agriProdType=")
    if hasattr(agriProdType,'__iter__') and not isinstance(agriProdType, str):
        if len(agriProdType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = agriProdType
            requestString.append(None)
        else:
            requestString.append(','.join(agriProdType))
    else:
        requestString.append(agriProdType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__agriProdMonthlyAVGGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__agriProdMonthlyAVGGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'symbolDY', u'agriProdName', u'agriProdType', u'month', u'avgPrice', u'yoyMonth', u'momMonth']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'symbolDY': 'str','agriProdName': 'str','agriProdType': 'str','month': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoInfoRrpGet(indicID = "", frequency = "", unit = "", statType = "", region = "", country = "", currency = "", infoSource = "", beginTime = "", endTime = "", isPub = "", field = "", pandas = "1"):
    """
    宏观行业指标(产品用)，包含聚源等多个来源的宏观行业指标。输入指标代码或单位、频度等，获取相关指标信息。
    
    :param indicID: 指标代码，可多值输入，为空则输出所有,可以是列表,可空
    :param frequency: 频度，具体参考常量表DataAPI.SysCodeGet中codeTypeID=80001的内容,可以是列表,可空
    :param unit: 单位，具体参考常量表DataAPI.SysCodeGet中codeTypeID=10015的内容,可以是列表,可空
    :param statType: 统计类型，具体参考常量表DataAPI.SysCodeGet中codeTypeID=80004的内容,可以是列表,可空
    :param region: 地区，具体参考常量表DataAPI.SysCodeGet中codeTypeID=10003的内容,可以是列表,可空
    :param country: 国家，具体参考常量表DataAPI.SysCodeGet中codeTypeID=10031的内容,可以是列表,可空
    :param currency: 货币，具体参考常量表DataAPI.SysCodeGet中codeTypeID=10004的内容,可以是列表,可空
    :param infoSource: 指标发布来源，具体参考常量表DataAPI.SysCodeGet中codeTypeID=80002的内容,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param isPub: 是否公开,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoInfoRrp.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    requestString.append("&frequency=")
    if hasattr(frequency,'__iter__') and not isinstance(frequency, str):
        if len(frequency) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = frequency
            requestString.append(None)
        else:
            requestString.append(','.join(frequency))
    else:
        requestString.append(frequency)
    requestString.append("&unit=")
    if hasattr(unit,'__iter__') and not isinstance(unit, str):
        if len(unit) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = unit
            requestString.append(None)
        else:
            requestString.append(','.join(unit))
    else:
        requestString.append(unit)
    requestString.append("&statType=")
    if hasattr(statType,'__iter__') and not isinstance(statType, str):
        if len(statType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statType
            requestString.append(None)
        else:
            requestString.append(','.join(statType))
    else:
        requestString.append(statType)
    requestString.append("&region=")
    if hasattr(region,'__iter__') and not isinstance(region, str):
        if len(region) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = region
            requestString.append(None)
        else:
            requestString.append(','.join(region))
    else:
        requestString.append(region)
    requestString.append("&country=")
    if hasattr(country,'__iter__') and not isinstance(country, str):
        if len(country) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = country
            requestString.append(None)
        else:
            requestString.append(','.join(country))
    else:
        requestString.append(country)
    requestString.append("&currency=")
    if hasattr(currency,'__iter__') and not isinstance(currency, str):
        if len(currency) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currency
            requestString.append(None)
        else:
            requestString.append(','.join(currency))
    else:
        requestString.append(currency)
    requestString.append("&infoSource=")
    if hasattr(infoSource,'__iter__') and not isinstance(infoSource, str):
        if len(infoSource) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = infoSource
            requestString.append(None)
        else:
            requestString.append(','.join(infoSource))
    else:
        requestString.append(infoSource)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(isPub, str) and not isinstance(isPub, unicode):
        isPub = str(isPub)

    requestString.append("&isPub=%s"%(isPub))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoInfoRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoInfoRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'indicName', u'frequency', u'unit', u'statType', u'accuracy', u'region', u'country', u'currency', u'infoSource', u'memo', u'src', u'createTime', u'updateTime', u'publishStatus', u'isUpdate', u'isPub', u'infoSourceCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indicName': 'str','frequency': 'str','unit': 'str','statType': 'str','region': 'str','country': 'str','currency': 'str','infoSource': 'str','memo': 'str','src': 'str','infoSourceCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpOldDYGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联原宏观行业数据(产品用)，包含通联原宏观及行业的所有数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpOldDY.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpOldDYGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpOldDYGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpOldDYGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联原宏观行业最新期数据(产品用)，包含通联原宏观及行业的所有数据。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpOldDY.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpOldDYGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpOldDYGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoSrcRrpGet(field = "", pandas = "1"):
    """
    获取宏观行业数据源列表(产品用)，输入参数为空、返回所有数据源SRC列表。
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoSrcRrp.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoSrcRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoSrcRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'src']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'src': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYQuotedGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-引用他表数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYQuoted.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYQuotedGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYQuotedGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYQuotedGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-引用他表最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYQuoted.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYQuotedGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYQuotedGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYChinaGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-中国数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYChina.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYChinaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYChinaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYChinaGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-中国指标最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYChina.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYChinaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYChinaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYAriculturalGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-农林牧渔数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYAricultural.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYAriculturalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYAriculturalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYAutomobileGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-汽车数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYAutomobile.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYAutomobileGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYAutomobileGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYBiologicalmedicineGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-医药生物数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYBiologicalmedicine.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYBiologicalmedicineGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYBiologicalmedicineGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYBuildingmaterialsGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-建材数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYBuildingmaterials.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYBuildingmaterialsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYBuildingmaterialsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYCateringtourismGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-旅游酒店数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYCateringtourism.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYCateringtourismGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYCateringtourismGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYChemicalGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-化工数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYChemical.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYChemicalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYChemicalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYCommercialtradeGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-批发零售业数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYCommercialtrade.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYCommercialtradeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYCommercialtradeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYCultureGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-文教体娱及工艺品数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYCulture.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYCultureGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYCultureGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYElectronicGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-电子电器数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYElectronic.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYElectronicGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYElectronicGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYEnergyGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-能源数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYEnergy.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYEnergyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYEnergyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYFinancialservicesGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-金融保险业数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYFinancialservices.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYFinancialservicesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYFinancialservicesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYFoodbeverageGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-食品饮料数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYFoodbeverage.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYFoodbeverageGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYFoodbeverageGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYInfoserviceGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-信息服务数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYInfoservice.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYInfoserviceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYInfoserviceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYLightmanufactueGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-轻工制造数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYLightmanufactue.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYLightmanufactueGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYLightmanufactueGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYMachineryequipmentGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-机械设备数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYMachineryequipment.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYMachineryequipmentGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYMachineryequipmentGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYNonferrousmetalsGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-有色金属数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYNonferrousmetals.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYNonferrousmetalsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYNonferrousmetalsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYOthersGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-综合数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYOthers.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYOthersGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYOthersGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYRealestateGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-房地产及建筑业数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYRealestate.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYRealestateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYRealestateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYSteelGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-钢铁数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYSteel.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYSteelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYSteelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYTextileclothingGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-纺织服装数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYTextileclothing.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYTextileclothingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYTextileclothingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYTraffictransportGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-交通运输数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYTraffictransport.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYTraffictransportGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYTraffictransportGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYUtilityindustryGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-公用事业数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYUtilityindustry.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYUtilityindustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYUtilityindustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYAriculturalGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-农林牧渔最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYAricultural.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYAriculturalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYAriculturalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYAutomobileGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-汽车最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYAutomobile.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYAutomobileGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYAutomobileGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYBiologicalmedicineGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-医药生物最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYBiologicalmedicine.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYBiologicalmedicineGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYBiologicalmedicineGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYBuildingmaterialsGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-建材最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYBuildingmaterials.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYBuildingmaterialsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYBuildingmaterialsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYCateringtourismGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-旅游酒店最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYCateringtourism.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYCateringtourismGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYCateringtourismGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYChemicalGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-化工最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYChemical.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYChemicalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYChemicalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYCommercialtradeGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-批发零售业最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYCommercialtrade.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYCommercialtradeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYCommercialtradeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYCultureGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-文教体娱及工艺品最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYCulture.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYCultureGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYCultureGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYElectronicGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-电子电器最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYElectronic.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYElectronicGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYElectronicGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYEnergyGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-能源最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYEnergy.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYEnergyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYEnergyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYFinancialservicesGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-金融保险业最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYFinancialservices.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYFinancialservicesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYFinancialservicesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYFoodbeverageGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-食品饮料最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYFoodbeverage.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYFoodbeverageGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYFoodbeverageGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYInfoserviceGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-信息服务最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYInfoservice.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYInfoserviceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYInfoserviceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYLightmanufactueGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-轻工制造最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYLightmanufactue.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYLightmanufactueGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYLightmanufactueGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYMachineryequipmentGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-机械设备最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYMachineryequipment.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYMachineryequipmentGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYMachineryequipmentGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYNonferrousmetalsGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-有色金属最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYNonferrousmetals.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYNonferrousmetalsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYNonferrousmetalsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYOthersGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-综合最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYOthers.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYOthersGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYOthersGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYRealestateGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-房地产及建筑业最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYRealestate.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYRealestateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYRealestateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYSteelGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-钢铁最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYSteel.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYSteelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYSteelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYTextileclothingGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-纺织服装最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYTextileclothing.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYTextileclothingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYTextileclothingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYTraffictransportGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-交通运输最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYTraffictransport.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYTraffictransportGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYTraffictransportGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYUtilityindustryGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-公用事业最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYUtilityindustry.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYUtilityindustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYUtilityindustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYFinGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-行业财务数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYFin.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYFinGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYFinGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYFinGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-行业财务最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表,可空
    :param beginTime: 更新开始时间，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param endTime: 更新截止时间，为空则表示至今为止，格式为：YYYYMMDD、YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：20150226、2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYFin.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYFinGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYFinGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoSysUnitTransRrpGet(unitCD = "", unitCN = "", field = "", pandas = "1"):
    """
    
    
    :param unitCD: 单位代码，可多值输入,可以是列表,可空
    :param unitCN: 单位名称，可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoSysUnitTransRrp.csv?ispandas=1&') 
    requestString.append("unitCD=")
    if hasattr(unitCD,'__iter__') and not isinstance(unitCD, str):
        if len(unitCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = unitCD
            requestString.append(None)
        else:
            requestString.append(','.join(unitCD))
    else:
        requestString.append(unitCD)
    requestString.append("&unitCN=")
    if hasattr(unitCN,'__iter__') and not isinstance(unitCN, str):
        if len(unitCN) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = unitCN
            requestString.append(None)
        else:
            requestString.append(','.join(unitCN))
    else:
        requestString.append(unitCN)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoSysUnitTransRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoSysUnitTransRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unitCD', u'unitCN', u'multiply', u'number', u'minUnitCD', u'minUnitCN']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'unitCD': 'str','unitCN': 'str','number': 'str','minUnitCD': 'str','minUnitCN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpEcoCalendarDGet(indicID = "", beginDate = "", endDate = "", regionCD = "", field = "", pandas = "1"):
    """
    经济事件日期及上下期日期
    
    :param indicID: 事件代码，可输入一个或多个，用","分隔，如"CHN001"、"CHN001,CHN005",可以是列表,indicID、beginDate、endDate至少选择一个
    :param beginDate: 起始指标日期，输入格式“YYYYMMDD”,indicID、beginDate、endDate至少选择一个
    :param endDate: 结束指标日期，输入格式“YYYYMMDD”,indicID、beginDate、endDate至少选择一个
    :param regionCD: 国家代码，如'CHN',可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getRrpEcoCalendarD.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(regionCD, str) and not isinstance(regionCD, unicode):
        regionCD = str(regionCD)

    requestString.append("&regionCD=%s"%(regionCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpEcoCalendarDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpEcoCalendarDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'regionCD', u'dataDate', u'bfDataDate', u'afDataDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indicID': 'str','regionCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpEcoCalendarPGet(indicID = "", beginDate = "", endDate = "", beginPubDateBJ = "", endPubDateBJ = "", regionCD = "", field = "", pandas = "1"):
    """
    经济事件发布日期及上下期发布日期
    
    :param indicID: 事件代码，可输入一个或多个，用","分隔，如"CHN001"、"CHN001,CHN005",可以是列表,indicID、beginDate、endDate、beginPubDateBJ、endPubDateBJ至少选择一个
    :param beginDate: 起始指标日期，输入格式“YYYYMMDD”,indicID、beginDate、endDate、beginPubDateBJ、endPubDateBJ至少选择一个
    :param endDate: 结束指标日期，输入格式“YYYYMMDD”,indicID、beginDate、endDate、beginPubDateBJ、endPubDateBJ至少选择一个
    :param beginPubDateBJ: 起始发布日期(北京时间)，输入格式“YYYYMMDD”,indicID、beginDate、endDate、beginPubDateBJ、endPubDateBJ至少选择一个
    :param endPubDateBJ: 结束发布日期(北京时间)，输入格式“YYYYMMDD”,indicID、beginDate、endDate、beginPubDateBJ、endPubDateBJ至少选择一个
    :param regionCD: 国家代码，如'CHN',可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getRrpEcoCalendarP.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginPubDateBJ = beginPubDateBJ.strftime('%Y%m%d')
    except:
        beginPubDateBJ = beginPubDateBJ.replace('-', '')
    requestString.append("&beginPubDateBJ=%s"%(beginPubDateBJ))
    try:
        endPubDateBJ = endPubDateBJ.strftime('%Y%m%d')
    except:
        endPubDateBJ = endPubDateBJ.replace('-', '')
    requestString.append("&endPubDateBJ=%s"%(endPubDateBJ))
    if not isinstance(regionCD, str) and not isinstance(regionCD, unicode):
        regionCD = str(regionCD)

    requestString.append("&regionCD=%s"%(regionCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpEcoCalendarPGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpEcoCalendarPGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'regionCD', u'dataDate', u'publishDateBJ', u'bfPublishDateBJ', u'afPublishDateBJ']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indicID': 'str','regionCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYGlobeRestGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-海外其他国家数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可以使用getEcoInfoRrp设置相关参数获取到。,可以是列表
    :param beginDate: 根据数据截止日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据数据截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYGlobeRest.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYGlobeRestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYGlobeRestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYGlobeRestGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-海外其他国家最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可以使用getEcoInfoRrp设置相关参数获取到。,可以是列表,可空
    :param beginTime: 根据更新时间范围查询的开始时间，格式为YYYYMMDD或YYYY-MM-DDTHH:mm:SS，如：20150226、2015-02-26T18:05:24。,可空
    :param endTime: 根据更新时间范围查询的开始时间，格式为YYYYMMDD或YYYY-MM-DDTHH:mm:SS，如：20150226、2015-02-26T18:05:24。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYGlobeRest.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYGlobeRestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYGlobeRestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYRegionGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-中国分地区数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可以使用getEcoInfoRrp设置相关参数获取到。,可以是列表
    :param beginDate: 根据数据截止日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据数据截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYRegion.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYRegionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYRegionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYRegionGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-中国分地区最新期数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可以使用getEcoInfoRrp设置相关参数获取到。,可以是列表,可空
    :param beginTime: 根据数据截止日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endTime: 根据数据截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYRegion.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYRegionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYRegionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYGlobeEuGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-欧洲数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可以使用getEcoInfoRrp设置相关参数获取到。,可以是列表
    :param beginDate: 根据数据截止日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据数据截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYGlobeEu.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYGlobeEuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYGlobeEuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYGlobeEuGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-欧洲最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可以使用getEcoInfoRrp设置相关参数获取到。,可以是列表,可空
    :param beginTime: 根据更新时间范围查询的开始时间，格式为YYYYMMDD或YYYY-MM-DDTHH:mm:SS，如：20150226、2015-02-26T18:05:24。,可空
    :param endTime: 根据更新时间范围查询的开始时间，格式为YYYYMMDD或YYYY-MM-DDTHH:mm:SS，如：20150226、2015-02-26T18:05:24。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYGlobeEu.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYGlobeEuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYGlobeEuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataRrpNewDYGlobeUsaGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    通联新宏观行业-美国数据(产品用)。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可以使用getEcoInfoRrp设置相关参数获取到。,可以是列表
    :param beginDate: 根据数据截止日期范围查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据数据截止日期范围查询的结束日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataRrpNewDYGlobeUsa.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataRrpNewDYGlobeUsaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataRrpNewDYGlobeUsaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoDataLatestRrpNewDYGlobeUsaGet(indicID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    通联新宏观行业-美国最新期数据(产品用)。输入指标ID，获取指标最新期数据。
    
    :param indicID: 指标代码，可以使用getEcoInfoRrp设置相关参数获取到。,可以是列表,可空
    :param beginTime: 根据更新时间范围查询的开始时间，格式为YYYYMMDD或YYYY-MM-DDTHH:mm:SS，如：20150226、2015-02-26T18:05:24。,可空
    :param endTime: 根据更新时间范围查询的开始时间，格式为YYYYMMDD或YYYY-MM-DDTHH:mm:SS，如：20150226、2015-02-26T18:05:24。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataLatestRrpNewDYGlobeUsa.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoDataLatestRrpNewDYGlobeUsaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoDataLatestRrpNewDYGlobeUsaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime', u'beginDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EcoInfoRrp2Get(region = "", currency = "", unit = "", country = "", infoSource = "", statType = "", indicID = "", endTime = "", beginTime = "", frequency = "", isPub = "", field = "", pandas = "1"):
    """
    宏观行业指标v2(产品用)，输入指标代码或单位、频度等，获取相关指标信息。
    
    :param region: 例如，全国、东部、珠三角。可以使用DataAPI.SysCodeGet接口获取所有取值，codeTypeID=10003。,可以是列表,可空
    :param currency: 例如，美元。可以使用DataAPI.SysCodeGet接口获取所有取值，codeTypeID=10004。,可以是列表,可空
    :param unit: 例如，%、‰、万元。可以使用DataAPI.SysCodeGet接口获取所有取值，codeTypeID=10015。,可以是列表,可空
    :param country: 例如，欧盟。可以使用DataAPI.SysCodeGet接口获取所有取值，codeTypeID=10031。,可以是列表,可空
    :param infoSource: 例如，国家统计局、省统计局、统计年报。可以使用DataAPI.SysCodeGet接口获取所有取值，codeTypeID=80002。,可以是列表,可空
    :param statType: 例如，当期值、累计值、同比增减。可以使用DataAPI.SysCodeGet接口获取所有取值，codeTypeID=80004。,可以是列表,可空
    :param indicID: 指标代码,可以是列表,可空
    :param endTime: 根据更新时间范围查询的开始时间，格式为：YYYYMMDD或YYYY-MM-DDTHH:mm:SS，如：20150226、2015-02-26T18:05:24,可空
    :param beginTime: 根据更新时间范围查询的开始时间，格式为：YYYYMMDD或YYYY-MM-DDTHH:mm:SS，如：20150226、2015-02-26T18:05:24,可空
    :param frequency: 例如，年、半年、月、周、日。,可以是列表,可空
    :param isPub: 是否公开,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoInfoRrp2.csv?ispandas=1&') 
    requestString.append("region=")
    if hasattr(region,'__iter__') and not isinstance(region, str):
        if len(region) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = region
            requestString.append(None)
        else:
            requestString.append(','.join(region))
    else:
        requestString.append(region)
    requestString.append("&currency=")
    if hasattr(currency,'__iter__') and not isinstance(currency, str):
        if len(currency) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = currency
            requestString.append(None)
        else:
            requestString.append(','.join(currency))
    else:
        requestString.append(currency)
    requestString.append("&unit=")
    if hasattr(unit,'__iter__') and not isinstance(unit, str):
        if len(unit) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = unit
            requestString.append(None)
        else:
            requestString.append(','.join(unit))
    else:
        requestString.append(unit)
    requestString.append("&country=")
    if hasattr(country,'__iter__') and not isinstance(country, str):
        if len(country) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = country
            requestString.append(None)
        else:
            requestString.append(','.join(country))
    else:
        requestString.append(country)
    requestString.append("&infoSource=")
    if hasattr(infoSource,'__iter__') and not isinstance(infoSource, str):
        if len(infoSource) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = infoSource
            requestString.append(None)
        else:
            requestString.append(','.join(infoSource))
    else:
        requestString.append(infoSource)
    requestString.append("&statType=")
    if hasattr(statType,'__iter__') and not isinstance(statType, str):
        if len(statType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statType
            requestString.append(None)
        else:
            requestString.append(','.join(statType))
    else:
        requestString.append(statType)
    requestString.append("&indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    requestString.append("&frequency=")
    if hasattr(frequency,'__iter__') and not isinstance(frequency, str):
        if len(frequency) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = frequency
            requestString.append(None)
        else:
            requestString.append(','.join(frequency))
    else:
        requestString.append(frequency)
    if not isinstance(isPub, str) and not isinstance(isPub, unicode):
        isPub = str(isPub)

    requestString.append("&isPub=%s"%(isPub))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EcoInfoRrp2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EcoInfoRrp2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'regionCD', u'currencyCD', u'unitCD', u'countryCD', u'frequencyCD', u'originSrcCD', u'importance', u'infoSourceCD', u'publishStatusCN', u'indicID', u'indicName', u'indicDisplayName', u'indicNameEN', u'level', u'dyCD', u'parentCD', u'displayOrder', u'isList', u'frequency', u'unit', u'statType', u'statTypeCN', u'region', u'country', u'currency', u'accuracy', u'memo', u'memoEN', u'infoSource', u'importanceCN', u'publishStatus', u'isPub', u'isUpdate', u'isFORMULA', u'dataTABLE', u'originSrcCN', u'updateTime', u'createTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'regionCD': 'str','currencyCD': 'str','unitCD': 'str','countryCD': 'str','frequencyCD': 'str','originSrcCD': 'str','infoSourceCD': 'str','publishStatusCN': 'str','indicName': 'str','indicDisplayName': 'str','indicNameEN': 'str','dyCD': 'str','parentCD': 'str','frequency': 'str','unit': 'str','statType': 'str','statTypeCN': 'str','region': 'str','country': 'str','currency': 'str','memo': 'str','memoEN': 'str','infoSource': 'str','importanceCN': 'str','dataTABLE': 'str','originSrcCN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SbjHouseAppExpDistrictGet(beginDate, category = "", area = "", district = "", endDate = "", field = "", pandas = "1"):
    """
    包含家用电器行业分出口地区、分品类的出口数据，如当期出口、累计出口、去年同期出口、去年同期累计出口等数据，具体内容可参见数据样例；历史数据从2015年2月开始，数据按月更新。
    
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param category: 家电品类名称，可模糊查询,category、area至少选择一个
    :param area: 发货地点,category、area至少选择一个
    :param district: 经营地区,可空
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjHouseAppExpDistrict.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(category, str) and not isinstance(category, unicode):
        category = str(category)

    requestString.append("&category=%s"%(category))
    if not isinstance(area, str) and not isinstance(area, unicode):
        area = str(area)

    requestString.append("&area=%s"%(area))
    if not isinstance(district, str) and not isinstance(district, unicode):
        district = str(district)

    requestString.append("&district=%s"%(district))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SbjHouseAppExpDistrictGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SbjHouseAppExpDistrictGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'category', u'area', u'district', u'periodDate', u'volume', u'value', u'accumVolume', u'accumValue', u'volumeYoy', u'valueYoy', u'accumVolumeYoy', u'accumValueYoy', u'valueUnit', u'volumeUnit', u'enFrequency', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'category': 'str','area': 'str','district': 'str','valueUnit': 'str','volumeUnit': 'str','enFrequency': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SbjHouseAppOutputGet(category = "", district = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    包含家用电器行业分地区产量数据，如当月数量、上月数量、当月累计、月同比增长、累计同比增长等数据，具体内容可参见数据样例；历史数据从2015年2月开始，数据按月更新。
    
    :param category: 类型，可模糊查询,category、district至少选择一个
    :param district: 地区，可模糊查询,category、district至少选择一个
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjHouseAppOutput.csv?ispandas=1&') 
    if not isinstance(category, str) and not isinstance(category, unicode):
        category = str(category)

    requestString.append("category=%s"%(category))
    if not isinstance(district, str) and not isinstance(district, unicode):
        district = str(district)

    requestString.append("&district=%s"%(district))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SbjHouseAppOutputGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SbjHouseAppOutputGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'category', u'district', u'volume', u'volumeLast', u'accumVolume', u'volumeYoy', u'accumVolumeYoy', u'unit', u'enFrequency', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'category': 'str','district': 'str','unit': 'str','enFrequency': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SbjHouseAppExpPrdGet(beginDate, product = "", category = "", customCD = "", endDate = "", field = "", pandas = "1"):
    """
    包含家用电器行业分产品出口数据，如当期出口、累计出口、去年同期出口等数据，具体内容可参见数据样例；历史数据从2015年2月开始，数据按月更新。
    
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param product: 商品名称，可模糊查询,product、category至少选择一个
    :param category: 类型，可模糊查询,product、category至少选择一个
    :param customCD: 海关税号，可模糊查询,可空
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjHouseAppExpPrd.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(product, str) and not isinstance(product, unicode):
        product = str(product)

    requestString.append("&product=%s"%(product))
    if not isinstance(category, str) and not isinstance(category, unicode):
        category = str(category)

    requestString.append("&category=%s"%(category))
    if not isinstance(customCD, str) and not isinstance(customCD, unicode):
        customCD = str(customCD)

    requestString.append("&customCD=%s"%(customCD))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SbjHouseAppExpPrdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SbjHouseAppExpPrdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'customCD', u'product', u'category', u'volume', u'accumVolume', u'volumeYoy', u'accumVolumeYoy', u'value', u'accumValue', u'valueYoy', u'unit', u'volumeUnit', u'valueUnit', u'enFrequency', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'customCD': 'str','product': 'str','category': 'str','volumeUnit': 'str','valueUnit': 'str','enFrequency': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SbjHouseAppRankBrandGet(beginDate, category = "", brand = "", endDate = "", field = "", pandas = "1"):
    """
    家电销售占有率按品牌排行。如冰箱各品牌销售占有率及排行，洗衣机各品牌销售占有率及排行。具体内容可参见数据样例；历史数据从2015年2月开始，数据按月更新。
    
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param category: 家电商品类别,category、brand至少选择一个
    :param brand: 家电品牌,category、brand至少选择一个
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjHouseAppRankBrand.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(category, str) and not isinstance(category, unicode):
        category = str(category)

    requestString.append("&category=%s"%(category))
    if not isinstance(brand, str) and not isinstance(brand, unicode):
        brand = str(brand)

    requestString.append("&brand=%s"%(brand))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SbjHouseAppRankBrandGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SbjHouseAppRankBrandGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'category', u'serialNO', u'brand', u'marketShare', u'enFrequency', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'category': 'str','brand': 'str','enFrequency': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SbjHouseAppRankBrandDetailGet(beginDate, categorySub = "", brand = "", endDate = "", field = "", pandas = "1"):
    """
    家电分产品的销售占有率按各品牌排行。如双开门冰箱和单冷藏冰箱的分品牌的销售占有率及排行。具体内容可参见数据样例；历史数据从2015年2月开始，数据按月更新。
    
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param categorySub: 家电商品类别,categorySub、brand至少选择一个
    :param brand: 家电品牌,categorySub、brand至少选择一个
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjHouseAppRankBrandDetail.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(categorySub, str) and not isinstance(categorySub, unicode):
        categorySub = str(categorySub)

    requestString.append("&categorySub=%s"%(categorySub))
    if not isinstance(brand, str) and not isinstance(brand, unicode):
        brand = str(brand)

    requestString.append("&brand=%s"%(brand))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SbjHouseAppRankBrandDetailGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SbjHouseAppRankBrandDetailGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'categorySub', u'serialNO', u'brand', u'marketShare', u'enFrequency', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'categorySub': 'str','brand': 'str','enFrequency': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SbjHouseAppRankChgGet(beginDate, category = "", brand = "", endDate = "", field = "", pandas = "1"):
    """
    家电排名变化，包括不同品牌的冰箱、空调、洗衣机的上月销售量占比、当月销售量占比、排名变化情况和销售量占比变化等数据。
    
    :param beginDate: 开始日期,所查询的数据起始时间,输入格式"YYYYMMDD"
    :param category: 家电品类名称,可模糊查询,category、brand至少选择一个
    :param brand: 家电品牌,category、brand至少选择一个
    :param endDate: 截止日期,所查询的数据结束时间,输入格式"YYYYMMDD",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjHouseAppRankChg.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(category, str) and not isinstance(category, unicode):
        category = str(category)

    requestString.append("&category=%s"%(category))
    if not isinstance(brand, str) and not isinstance(brand, unicode):
        brand = str(brand)

    requestString.append("&brand=%s"%(brand))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SbjHouseAppRankChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SbjHouseAppRankChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'category', u'brand', u'serialNO', u'marketShareLast', u'marketShare', u'chgType', u'chgRatio', u'enFrequency', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'category': 'str','brand': 'str','chgType': 'str','enFrequency': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SbjHouseAppRankModelGet(beginDate, categorySub = "", brand = "", model = "", endDate = "", field = "", pandas = "1"):
    """
    家电畅销型号，包括不同类型、品牌和型号的冰箱、彩电、空调、洗衣机的平均单价和销售量占比等数据。
    
    :param beginDate: 开始日期,所查询的数据起始时间,输入格式"YYYYMMDD"
    :param categorySub: 家电品类名称,可模糊查询,categorySub、brand至少选择一个
    :param brand: 家电品牌,categorySub、brand至少选择一个
    :param model: 家电型号,可空
    :param endDate: 截止日期,所查询的数据结束时间,输入格式"YYYYMMDD",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjHouseAppRankModel.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(categorySub, str) and not isinstance(categorySub, unicode):
        categorySub = str(categorySub)

    requestString.append("&categorySub=%s"%(categorySub))
    if not isinstance(brand, str) and not isinstance(brand, unicode):
        brand = str(brand)

    requestString.append("&brand=%s"%(brand))
    if not isinstance(model, str) and not isinstance(model, unicode):
        model = str(model)

    requestString.append("&model=%s"%(model))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SbjHouseAppRankModelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SbjHouseAppRankModelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'categorySub', u'brand', u'model', u'serialNO', u'averPrice', u'unit', u'marketShare', u'enFrequency', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'categorySub': 'str','brand': 'str','model': 'str','unit': 'str','enFrequency': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SbjHouseHoldGet(channel = "", category = "", brand = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    家电销售数据，包括线上、线下渠道各品类、各品牌家电的销售额、销售量和均价数据。
    
    :param channel: 家电销售渠道，分为线上和线下,channel、category、brand、beginDate、endDate至少选择一个
    :param category: 家电品类名称,可模糊查询,channel、category、brand、beginDate、endDate至少选择一个
    :param brand: 家电品牌,channel、category、brand、beginDate、endDate至少选择一个
    :param beginDate: 开始日期,所查询的数据起始时间,输入格式"YYYYMMDD",channel、category、brand、beginDate、endDate至少选择一个
    :param endDate: 截止日期,所查询的数据结束时间,输入格式"YYYYMMDD",channel、category、brand、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjHouseHold.csv?ispandas=1&') 
    if not isinstance(channel, str) and not isinstance(channel, unicode):
        channel = str(channel)

    requestString.append("channel=%s"%(channel))
    if not isinstance(category, str) and not isinstance(category, unicode):
        category = str(category)

    requestString.append("&category=%s"%(category))
    if not isinstance(brand, str) and not isinstance(brand, unicode):
        brand = str(brand)

    requestString.append("&brand=%s"%(brand))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SbjHouseHoldGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SbjHouseHoldGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'channel', u'category', u'brand', u'sales', u'salesShare', u'salesYoy', u'salesMom', u'salesVolume', u'salesVolumeShare', u'salesVolumeYoy', u'salesVolumeMom', u'priceAverage', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'channel': 'str','category': 'str','brand': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __BondYield10yearGet(beginDate = "", endDate = "", beginRate = "", endRate = "", beginEquRate = "", endEquRate = "", beginSpread = "", endSpread = "", SpreadChgDirection = "", field = "", pandas = "1"):
    """
    10年期国债利率到期收益率、估计均衡收益率、原始与估计值利差、利差变化方向
    
    :param beginDate: 起始日期,可空
    :param endDate: 截止日期,可空
    :param beginRate: 原始到期收益率起始值,可空
    :param endRate: 原始到期收益率结束值,可空
    :param beginEquRate: 估计均衡收益率起始值,可空
    :param endEquRate: 估计均衡收益率结束值,可空
    :param beginSpread: 原始与估计值利差起始值,可空
    :param endSpread: 原始与估计值利差结束值,可空
    :param SpreadChgDirection: 利差变化方向,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getBondYield10year.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(beginRate, str) and not isinstance(beginRate, unicode):
        beginRate = str(beginRate)

    requestString.append("&beginRate=%s"%(beginRate))
    if not isinstance(endRate, str) and not isinstance(endRate, unicode):
        endRate = str(endRate)

    requestString.append("&endRate=%s"%(endRate))
    if not isinstance(beginEquRate, str) and not isinstance(beginEquRate, unicode):
        beginEquRate = str(beginEquRate)

    requestString.append("&beginEquRate=%s"%(beginEquRate))
    if not isinstance(endEquRate, str) and not isinstance(endEquRate, unicode):
        endEquRate = str(endEquRate)

    requestString.append("&endEquRate=%s"%(endEquRate))
    if not isinstance(beginSpread, str) and not isinstance(beginSpread, unicode):
        beginSpread = str(beginSpread)

    requestString.append("&beginSpread=%s"%(beginSpread))
    if not isinstance(endSpread, str) and not isinstance(endSpread, unicode):
        endSpread = str(endSpread)

    requestString.append("&endSpread=%s"%(endSpread))
    requestString.append("&SpreadChgDirection=")
    if hasattr(SpreadChgDirection,'__iter__') and not isinstance(SpreadChgDirection, str):
        if len(SpreadChgDirection) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = SpreadChgDirection
            requestString.append(None)
        else:
            requestString.append(','.join(SpreadChgDirection))
    else:
        requestString.append(SpreadChgDirection)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__BondYield10yearGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__BondYield10yearGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'name', u'estimationDate', u'treasBond10yYtm', u'treasBond10yEquYtm', u'yieldSpread', u'SpreadChgDirection', u'HistDistribPos', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RrpEcoCalendarGet(indicID = "", beginPubDate = "", endPubDate = "", beginPubTime = "", endPubTime = "", ecoIndicID = "", regionCD = "", beginDate = "", endDate = "", beginPubDateBJ = "", endPubDateBJ = "", beginPubTimeBJ = "", endPubTimeBJ = "", field = "", pandas = "1"):
    """
    重要经济事件的基础信息(含预发布日期)及指标数值。
    
    :param indicID: 事件代码，可输入一个或多个，用","分隔，如"CHN001"、"CHN001,CHN005",可以是列表,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param beginPubDate: 起始发布日期(当地)，输入格式“YYYYMMDD”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param endPubDate: 结束发布日期(当地)，输入格式“YYYYMMDD”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param beginPubTime: 起始发布时间(当地)，如“09:00:00”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param endPubTime: 结束发布时间(当地)，如“09:00:00”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param ecoIndicID: 经济指标代码，可输入一个或多个，用','分隔，如'1030000011'、'1030000011,1070003529',可以是列表,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param regionCD: 国家代码，如'CHN',indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param beginDate: 起始指标日期，输入格式“YYYYMMDD”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param endDate: 结束指标日期，输入格式“YYYYMMDD”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param beginPubDateBJ: 起始发布日期(北京时间)，输入格式“YYYYMMDD”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param endPubDateBJ: 结束发布日期(北京时间)，输入格式“YYYYMMDD”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param beginPubTimeBJ: 起始发布时间(北京时间)，如“09:00:00”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param endPubTimeBJ: 结束发布时间(北京时间)，如“09:00:00”,indicID、beginPubDate、endPubDate、beginPubTime、endPubTime、ecoIndicID、regionCD、beginDate、endDate、beginPubDateBJ、endPubDateBJ、beginPubTimeBJ、endPubTimeBJ至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getRrpEcoCalendar.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginPubDate = beginPubDate.strftime('%Y%m%d')
    except:
        beginPubDate = beginPubDate.replace('-', '')
    requestString.append("&beginPubDate=%s"%(beginPubDate))
    try:
        endPubDate = endPubDate.strftime('%Y%m%d')
    except:
        endPubDate = endPubDate.replace('-', '')
    requestString.append("&endPubDate=%s"%(endPubDate))
    try:
        beginPubTime = beginPubTime.strftime('%Y%m%d')
    except:
        beginPubTime = beginPubTime.replace('-', '')
    requestString.append("&beginPubTime=%s"%(beginPubTime))
    try:
        endPubTime = endPubTime.strftime('%Y%m%d')
    except:
        endPubTime = endPubTime.replace('-', '')
    requestString.append("&endPubTime=%s"%(endPubTime))
    requestString.append("&ecoIndicID=")
    if hasattr(ecoIndicID,'__iter__') and not isinstance(ecoIndicID, str):
        if len(ecoIndicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ecoIndicID
            requestString.append(None)
        else:
            requestString.append(','.join(ecoIndicID))
    else:
        requestString.append(ecoIndicID)
    if not isinstance(regionCD, str) and not isinstance(regionCD, unicode):
        regionCD = str(regionCD)

    requestString.append("&regionCD=%s"%(regionCD))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginPubDateBJ = beginPubDateBJ.strftime('%Y%m%d')
    except:
        beginPubDateBJ = beginPubDateBJ.replace('-', '')
    requestString.append("&beginPubDateBJ=%s"%(beginPubDateBJ))
    try:
        endPubDateBJ = endPubDateBJ.strftime('%Y%m%d')
    except:
        endPubDateBJ = endPubDateBJ.replace('-', '')
    requestString.append("&endPubDateBJ=%s"%(endPubDateBJ))
    try:
        beginPubTimeBJ = beginPubTimeBJ.strftime('%Y%m%d')
    except:
        beginPubTimeBJ = beginPubTimeBJ.replace('-', '')
    requestString.append("&beginPubTimeBJ=%s"%(beginPubTimeBJ))
    try:
        endPubTimeBJ = endPubTimeBJ.strftime('%Y%m%d')
    except:
        endPubTimeBJ = endPubTimeBJ.replace('-', '')
    requestString.append("&endPubTimeBJ=%s"%(endPubTimeBJ))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RrpEcoCalendarGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RrpEcoCalendarGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'nameCN', u'nameEN', u'publishDate', u'publishDateBJ', u'publishTime', u'publishTimeBJ', u'remarkCN', u'remarkEN', u'ecoIndicID', u'ecoNameCN', u'ecoNameEN', u'regionCD', u'regionNameCN', u'regionNameEN', u'unitCN', u'unitEN', u'freqCN', u'freqEN', u'indicTypeCN', u'indicTypeEN', u'position', u'srcNameCN', u'srcNameEN', u'isImp', u'indicDescCN', u'indicDescEN', u'dataDate', u'forecastValue', u'preValue', u'actValue', u'valueLy']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indicID': 'str','nameCN': 'str','nameEN': 'str','remarkCN': 'str','remarkEN': 'str','ecoNameCN': 'str','ecoNameEN': 'str','regionCD': 'str','regionNameCN': 'str','regionNameEN': 'str','unitCN': 'str','unitEN': 'str','freqCN': 'str','freqEN': 'str','indicTypeCN': 'str','indicTypeEN': 'str','srcNameCN': 'str','srcNameEN': 'str','isImp': 'str','indicDescCN': 'str','indicDescEN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoInfoProGet(indicID = "", parentID = "", indicName = "", dyCD = "", isUpdate = "", dataApiName = "", field = "", pandas = "1"):
    """
    宏观行业经济指标表，收录国家统计局、统计年鉴、海关总署、财政部等来源的大量经济指标，以及发布频率、统计类型、数据起止日期、数据存储表、数据API等信息。
    
    :param indicID: 指标代码,可以是列表,可空
    :param parentID: 父节点代码,用来查找该代码下一层级的指标，可多值输入,可以是列表,可空
    :param indicName: 指标展示中文名,可空
    :param dyCD: 展示代码,可以是列表,可空
    :param isUpdate: 指标是否还在持续更新数据，1-是；0-否,可空
    :param dataApiName: 数据API名称，例如“getEcoDataChina”,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoInfoPro.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    requestString.append("&parentID=")
    if hasattr(parentID,'__iter__') and not isinstance(parentID, str):
        if len(parentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = parentID
            requestString.append(None)
        else:
            requestString.append(','.join(parentID))
    else:
        requestString.append(parentID)
    if not isinstance(indicName, str) and not isinstance(indicName, unicode):
        indicName = str(indicName)

    requestString.append("&indicName=%s"%(indicName))
    requestString.append("&dyCD=")
    if hasattr(dyCD,'__iter__') and not isinstance(dyCD, str):
        if len(dyCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dyCD
            requestString.append(None)
        else:
            requestString.append(','.join(dyCD))
    else:
        requestString.append(dyCD)
    if not isinstance(isUpdate, str) and not isinstance(isUpdate, unicode):
        isUpdate = str(isUpdate)

    requestString.append("&isUpdate=%s"%(isUpdate))
    requestString.append("&dataApiName=")
    if hasattr(dataApiName,'__iter__') and not isinstance(dataApiName, str):
        if len(dataApiName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dataApiName
            requestString.append(None)
        else:
            requestString.append(','.join(dataApiName))
    else:
        requestString.append(dataApiName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoInfoProGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoInfoProGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'indicName', u'nameEN', u'dyCD', u'parentID', u'isList', u'frequency', u'unit', u'statType', u'accuracy', u'region', u'country', u'currency', u'importance', u'infoSource', u'memoCN', u'dataApiID', u'dataApiName', u'beginDate', u'endDate', u'isUpdate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indicName': 'str','nameEN': 'str','dyCD': 'str','parentID': 'str','frequency': 'str','unit': 'str','statType': 'str','region': 'str','country': 'str','currency': 'str','importance': 'str','infoSource': 'str','memoCN': 'str','dataApiName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjGameKfwGet(gamePlatform = "", gameName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    游戏开服数据，包括游戏平台、开服时间、游戏名称、服务器名称、运营商名称等信息
    
    :param gamePlatform: 游戏平台，包括客户端游戏、手机游戏、网页游戏，可模糊查询,gamePlatform、gameName、beginDate、endDate至少选择一个
    :param gameName: 游戏名称，可模糊查询,gamePlatform、gameName、beginDate、endDate至少选择一个
    :param beginDate: 开始日期,所查询的数据起始时间,输入格式"YYYYMMDD",gamePlatform、gameName、beginDate、endDate至少选择一个
    :param endDate: 截止日期,所查询的数据结束时间,输入格式"YYYYMMDD"，且需在想获取的数据日期上+1,gamePlatform、gameName、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjGameKfw.csv?ispandas=1&') 
    if not isinstance(gamePlatform, str) and not isinstance(gamePlatform, unicode):
        gamePlatform = str(gamePlatform)

    requestString.append("gamePlatform=%s"%(gamePlatform))
    if not isinstance(gameName, str) and not isinstance(gameName, unicode):
        gameName = str(gameName)

    requestString.append("&gameName=%s"%(gameName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjGameKfwGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjGameKfwGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'gamePlatform', u'gameName', u'serverName', u'line', u'system', u'operatorName', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'gamePlatform': 'str','gameName': 'str','serverName': 'str','line': 'str','system': 'str','operatorName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjPowerPlantStatGet(powerType = "", province = "", powerPlantName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    全国百万千瓦电厂生产数据，包括电厂名称、省份、电种类、装机容量、发电量和可用小时等数据
    
    :param powerType: 电种类，包括水电、核电、火电、抽水蓄能、合计等，可模糊查询,powerType、province、powerPlantName、beginDate、endDate至少选择一个
    :param province: 省份，可模糊查询,powerType、province、powerPlantName、beginDate、endDate至少选择一个
    :param powerPlantName: 电厂名称，可模糊查询,powerType、province、powerPlantName、beginDate、endDate至少选择一个
    :param beginDate: 开始日期,所查询的数据起始时间,输入格式"YYYYMMDD",powerType、province、powerPlantName、beginDate、endDate至少选择一个
    :param endDate: 截止日期,所查询的数据结束时间,输入格式"YYYYMMDD",powerType、province、powerPlantName、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjPowerPlantStat.csv?ispandas=1&') 
    if not isinstance(powerType, str) and not isinstance(powerType, unicode):
        powerType = str(powerType)

    requestString.append("powerType=%s"%(powerType))
    if not isinstance(province, str) and not isinstance(province, unicode):
        province = str(province)

    requestString.append("&province=%s"%(province))
    if not isinstance(powerPlantName, str) and not isinstance(powerPlantName, unicode):
        powerPlantName = str(powerPlantName)

    requestString.append("&powerPlantName=%s"%(powerPlantName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjPowerPlantStatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjPowerPlantStatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'powerType', u'province', u'powerPlantName', u'installCapa', u'powerGener', u'useTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'powerType': 'str','province': 'str','powerPlantName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjCarCmGet(beginDate, modelCN = "", competitiveMod = "", endDate = "", field = "", pandas = "1"):
    """
    记录各种类型汽车的竞争车型。
    
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param modelCN: 车型名称,modelCN、competitiveMod至少选择一个
    :param competitiveMod: 竞争车型,modelCN、competitiveMod至少选择一个
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjCarCm.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(modelCN, str) and not isinstance(modelCN, unicode):
        modelCN = str(modelCN)

    requestString.append("&modelCN=%s"%(modelCN))
    if not isinstance(competitiveMod, str) and not isinstance(competitiveMod, unicode):
        competitiveMod = str(competitiveMod)

    requestString.append("&competitiveMod=%s"%(competitiveMod))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjCarCmGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjCarCmGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'infoSource', u'modelCN', u'competitiveMod']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'infoSource': 'str','modelCN': 'str','competitiveMod': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjCarShareratioGet(beginDate, parentName = "", relatWithGrop = "", infoNameShort = "", endDate = "", field = "", pandas = "1"):
    """
    记录主要集团汽车企业股比情况，包含父节点编码、父节点名称、信息编码、信息名称、与集团公司关系、股权比例（%）。
    
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param parentName: 品牌，可模糊查询,parentName、relatWithGrop至少选择一个
    :param relatWithGrop: 与集团公司关系,parentName、relatWithGrop至少选择一个
    :param infoNameShort: 车系，可模糊查询,可空
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getSbjCarShareratio.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(parentName, str) and not isinstance(parentName, unicode):
        parentName = str(parentName)

    requestString.append("&parentName=%s"%(parentName))
    if not isinstance(relatWithGrop, str) and not isinstance(relatWithGrop, unicode):
        relatWithGrop = str(relatWithGrop)

    requestString.append("&relatWithGrop=%s"%(relatWithGrop))
    if not isinstance(infoNameShort, str) and not isinstance(infoNameShort, unicode):
        infoNameShort = str(infoNameShort)

    requestString.append("&infoNameShort=%s"%(infoNameShort))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjCarShareratioGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjCarShareratioGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'parentID', u'parentName', u'infoID', u'infoNameShort', u'relatWithGrop', u'equityPro', u'groupCN']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'parentName': 'str','infoNameShort': 'str','relatWithGrop': 'str','groupCN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataQuotedGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业的特色指标。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataQuoted.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataQuotedGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataQuotedGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataChinaGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-中国数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataChina.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataChinaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataChinaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndAgriculturalGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-农林牧渔数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndAgricultural.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndAgriculturalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndAgriculturalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndAutomobileGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-汽车数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndAutomobile.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndAutomobileGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndAutomobileGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndBiologicalmedicineGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-医药生物数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndBiologicalmedicine.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndBiologicalmedicineGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndBiologicalmedicineGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndBuildingmaterialsGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-建材数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndBuildingmaterials.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndBuildingmaterialsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndBuildingmaterialsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndCateringtourismGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-旅游酒店数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndCateringtourism.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndCateringtourismGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndCateringtourismGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndChemicalGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-化工数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndChemical.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndChemicalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndChemicalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndCommercialtradeGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-批发零售业数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndCommercialtrade.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndCommercialtradeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndCommercialtradeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndCultureGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-文教体娱及工艺品数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndCulture.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndCultureGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndCultureGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndElectronicGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-电子电器数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndElectronic.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndElectronicGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndElectronicGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndEnergyGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-能源数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndEnergy.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndEnergyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndEnergyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndFinancialservicesGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-金融保险业数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndFinancialservices.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndFinancialservicesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndFinancialservicesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndFoodbeverageGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-食品饮料数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndFoodbeverage.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndFoodbeverageGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndFoodbeverageGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndInfoserviceGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-信息服务数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndInfoservice.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndInfoserviceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndInfoserviceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndLightmanufactueGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-轻工制造数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndLightmanufactue.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndLightmanufactueGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndLightmanufactueGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndMachineryequipmentGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-机械设备数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndMachineryequipment.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndMachineryequipmentGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndMachineryequipmentGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndNonferrousmetalsGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-有色金属数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndNonferrousmetals.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndNonferrousmetalsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndNonferrousmetalsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndOthersGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-综合数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndOthers.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndOthersGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndOthersGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndRealestateGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-房地产及建筑业数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndRealestate.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndRealestateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndRealestateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndSteelGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-钢铁数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndSteel.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndSteelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndSteelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndTextileclothingGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-纺织服装数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndTextileclothing.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndTextileclothingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndTextileclothingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndTraffictransportGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-交通运输数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndTraffictransport.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndTraffictransportGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndTraffictransportGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataIndUtilityindustryGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-公用事业数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataIndUtilityindustry.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataIndUtilityindustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataIndUtilityindustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataFinGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-行业财务数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataFin.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataFinGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataFinGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataGlobeRestGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-海外其他国家数据，主要是日本的数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataGlobeRest.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataGlobeRestGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataGlobeRestGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataChinaRegionGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-中国分地区数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataChinaRegion.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataChinaRegionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataChinaRegionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataGlobeEuGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-欧盟数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataGlobeEu.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataGlobeEuGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataGlobeEuGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataGlobeUsaGet(indicID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    宏观行业-美国数据。输入指标ID，获取相关数据。
    
    :param indicID: 指标代码，可多值输入,可以是列表
    :param beginDate: 开始日期，所查询的指标数据起始时间，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，所查询的指标数据结束时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/macro/getEcoDataGlobeUsa.csv?ispandas=1&') 
    requestString.append("indicID=")
    if hasattr(indicID,'__iter__') and not isinstance(indicID, str):
        if len(indicID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indicID
            requestString.append(None)
        else:
            requestString.append(','.join(indicID))
    else:
        requestString.append(indicID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataGlobeUsaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataGlobeUsaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indicID', u'publishDate', u'periodDate', u'dataValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CsrcAnnoDetlGet(annoID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    描述了证监会公告详细信息，包括公告内容及附件标题。
    
    :param annoID: 公告ID,可以是列表,annoID、beginDate、endDate至少选择一个
    :param beginDate: 最新公告日起始日期，输入格式“YYYYMMDD”,annoID、beginDate、endDate至少选择一个
    :param endDate: 最新公告日截止日期，输入格式“YYYYMMDD”,annoID、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/anno/getCsrcAnnoDetl.csv?ispandas=1&') 
    requestString.append("annoID=")
    if hasattr(annoID,'__iter__') and not isinstance(annoID, str):
        if len(annoID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = annoID
            requestString.append(None)
        else:
            requestString.append(','.join(annoID))
    else:
        requestString.append(annoID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CsrcAnnoDetlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CsrcAnnoDetlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'annoID', u'accessoryID', u'publishDate', u'content', u'fullName', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'annoID': 'str','content': 'str','fullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CsrcAnnoInfoGet(annoID = "", publishInst = "", title = "", beginDate = "", endDate = "", dyClassifID = "", ogClassifID = "", field = "", pandas = "1"):
    """
    记录证监会公告基本信息与分类信息，包括发布日期、索引、公告标题、发布机构、主题词、公告原始链接等。
    
    :param annoID: 公告ID,可以是列表,annoID、publishInst、title至少选择一个
    :param publishInst: 发布机构,可以是列表,annoID、publishInst、title至少选择一个
    :param title: 公告标题,支持模糊查询,annoID、publishInst、title至少选择一个
    :param beginDate: 起始发布日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止发布日期，输入格式“YYYYMMDD”,可空
    :param dyClassifID: 通联分类ID，可通过getAnnoClassifInfo接口查询具体分类信息,可以是列表,可空
    :param ogClassifID: 原始分类ID，可通过getAnnoClassifInfo接口查询具体分类信息,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/anno/getCsrcAnnoInfo.csv?ispandas=1&') 
    requestString.append("annoID=")
    if hasattr(annoID,'__iter__') and not isinstance(annoID, str):
        if len(annoID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = annoID
            requestString.append(None)
        else:
            requestString.append(','.join(annoID))
    else:
        requestString.append(annoID)
    requestString.append("&publishInst=")
    if hasattr(publishInst,'__iter__') and not isinstance(publishInst, str):
        if len(publishInst) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = publishInst
            requestString.append(None)
        else:
            requestString.append(','.join(publishInst))
    else:
        requestString.append(publishInst)
    if not isinstance(title, str) and not isinstance(title, unicode):
        title = str(title)

    requestString.append("&title=%s"%(title))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&dyClassifID=")
    if hasattr(dyClassifID,'__iter__') and not isinstance(dyClassifID, str):
        if len(dyClassifID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = dyClassifID
            requestString.append(None)
        else:
            requestString.append(','.join(dyClassifID))
    else:
        requestString.append(dyClassifID)
    requestString.append("&ogClassifID=")
    if hasattr(ogClassifID,'__iter__') and not isinstance(ogClassifID, str):
        if len(ogClassifID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ogClassifID
            requestString.append(None)
        else:
            requestString.append(','.join(ogClassifID))
    else:
        requestString.append(ogClassifID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CsrcAnnoInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CsrcAnnoInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'annoID', u'title', u'publishDate', u'fileName', u'indexID', u'publishInst', u'keyWord', u'dyClassifID', u'ogClassifID', u'sourceLink', u's3Address', u'isUpload', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'annoID': 'str','title': 'str','fileName': 'str','indexID': 'str','publishInst': 'str','keyWord': 'str','dyClassifID': 'str','ogClassifID': 'str','sourceLink': 'str','s3Address': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquAnnoInfoGet(annoID = "", secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    描述沪深股票公告详细信息，包括公告来源、公告标题、公告链接、公告日期、公告对应代码。
    
    :param annoID: 公告ID,可以是列表,annoID、secID、ticker、beginDate至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,annoID、secID、ticker、beginDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,annoID、secID、ticker、beginDate至少选择一个
    :param beginDate: 发布起始日期，输入格式“YYYYMMDD”,annoID、secID、ticker、beginDate至少选择一个
    :param endDate: 发布截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/anno/getEquAnnoInfo.csv?ispandas=1&') 
    requestString.append("annoID=")
    if hasattr(annoID,'__iter__') and not isinstance(annoID, str):
        if len(annoID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = annoID
            requestString.append(None)
        else:
            requestString.append(','.join(annoID))
    else:
        requestString.append(annoID)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquAnnoInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquAnnoInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'annoID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'annoTitle', u'publishDate', u'actPubtime', u's3Address', u'partyID', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'annoID': 'str','secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','annoTitle': 'str','s3Address': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquAnnoClassifGet(annoID, classifCD = "", field = "", pandas = "1"):
    """
    描述每个公告的类别信息，包括通联分类和原始披露场所分类。
    
    :param annoID: 公告ID,可以是列表
    :param classifCD: 分类标准代码，1-通联分类，2-原始分类,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/anno/getEquAnnoClassif.csv?ispandas=1&') 
    requestString.append("annoID=")
    if hasattr(annoID,'__iter__') and not isinstance(annoID, str):
        if len(annoID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = annoID
            requestString.append(None)
        else:
            requestString.append(','.join(annoID))
    else:
        requestString.append(annoID)
    if not isinstance(classifCD, str) and not isinstance(classifCD, unicode):
        classifCD = str(classifCD)

    requestString.append("&classifCD=%s"%(classifCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquAnnoClassifGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquAnnoClassifGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'annoID', u'classifCD', u'annoClassifID', u'annoClassif', u'parentID', u'parentClassif', u'fstParentID', u'fstParentClassif', u'sourceType', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'annoID': 'str','classifCD': 'str','annoClassifID': 'str','annoClassif': 'str','parentID': 'str','parentClassif': 'str','sourceType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ResearchByTickerGet(beginDate, endDate, ticker = "", field = "", pandas = "1"):
    """
    根据证券交易代码，获取研报信息，包括研报ID，机构名称，作者，标题，发布时间，公司名称，研报分类等等
    
    :param beginDate: 发布时间查询起始日期，格式为yyyymmdd
    :param endDate: 发布时间查询截止日期，格式为yyyymmdd
    :param ticker: 证券在交易所的交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResearchByTicker.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ResearchByTickerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ResearchByTickerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'id', u'orgName', u'ticker', u'autheor', u'title', u'writeDate', u'publishDate', u'companyName', u'reportType', u'reportSubType', u'ratingContent', u'ratingChange', u'abstractText', u'industryName', u'targetPrice', u'targetPriceExpireDate', u'pageCount', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'orgName': 'str','ticker': 'str','autheor': 'str','title': 'str','companyName': 'str','reportType': 'str','reportSubType': 'str','ratingContent': 'str','ratingChange': 'str','abstractText': 'str','industryName': 'str','targetPrice': 'str','targetPriceExpireDate': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ResResearchReportStocksGet(industryID = "", reportID = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    记录研报ID、记录ID、交易代码、股票简称、行业名称、行业ID、研报发布日期、机构名称、研报页数、预测时收盘价、最高收盘价、涨跌幅。
    
    :param industryID: 行业ID，可模糊查询,可以是列表,industryID至少选择一个
    :param reportID: 研报ID,可以是列表,可空
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,可空
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResResearchReportStocks.csv?ispandas=1&') 
    requestString.append("industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    requestString.append("&reportID=")
    if hasattr(reportID,'__iter__') and not isinstance(reportID, str):
        if len(reportID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportID
            requestString.append(None)
        else:
            requestString.append(','.join(reportID))
    else:
        requestString.append(reportID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ResResearchReportStocksGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ResResearchReportStocksGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'recordID', u'tickerSymbol', u'secShortName', u'industryName', u'industryID', u'publishDate', u'orgName', u'pageCount', u'closePrice', u'highestPrice', u'changeRate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tickerSymbol': 'str','secShortName': 'str','industryName': 'str','industryID': 'str','orgName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ResResearchReportAuthorsGet(authorID = "", orgNameAgent = "", isNewFortune = "", field = "", pandas = "1"):
    """
    记录研报ID、研究员ID、研究员姓名、机构名称、研报机构名称、是否获得新财富得奖、更新时间。
    
    :param authorID: 研究员ID，可模糊查询,可以是列表,authorID、orgNameAgent、isNewFortune至少选择一个
    :param orgNameAgent: 研报机构名称，可模糊查询,可以是列表,authorID、orgNameAgent、isNewFortune至少选择一个
    :param isNewFortune: 是否获得新财富得奖,可以是列表,authorID、orgNameAgent、isNewFortune至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResResearchReportAuthors.csv?ispandas=1&') 
    requestString.append("authorID=")
    if hasattr(authorID,'__iter__') and not isinstance(authorID, str):
        if len(authorID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = authorID
            requestString.append(None)
        else:
            requestString.append(','.join(authorID))
    else:
        requestString.append(authorID)
    requestString.append("&orgNameAgent=")
    if hasattr(orgNameAgent,'__iter__') and not isinstance(orgNameAgent, str):
        if len(orgNameAgent) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = orgNameAgent
            requestString.append(None)
        else:
            requestString.append(','.join(orgNameAgent))
    else:
        requestString.append(orgNameAgent)
    requestString.append("&isNewFortune=")
    if hasattr(isNewFortune,'__iter__') and not isinstance(isNewFortune, str):
        if len(isNewFortune) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNewFortune
            requestString.append(None)
        else:
            requestString.append(','.join(isNewFortune))
    else:
        requestString.append(isNewFortune)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ResResearchReportAuthorsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ResResearchReportAuthorsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'authorID', u'authorName', u'orgName', u'orgNameAgent', u'isNewFortune', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'authorName': 'str','orgName': 'str','orgNameAgent': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ResDerReportTagGet(reportID = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    记录报告代码、证券代码、报告撰写日期、报告首次入库日期、标签代码、标签名称、是否利好、标签值、入库时间。
    
    :param reportID: 报告代码,可以是列表,reportID、endDate、beginDate至少选择一个
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,reportID、endDate、beginDate至少选择一个
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”,reportID、endDate、beginDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResDerReportTag.csv?ispandas=1&') 
    requestString.append("reportID=")
    if hasattr(reportID,'__iter__') and not isinstance(reportID, str):
        if len(reportID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportID
            requestString.append(None)
        else:
            requestString.append(','.join(reportID))
    else:
        requestString.append(reportID)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ResDerReportTagGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ResDerReportTagGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'tickerSymbol', u'createDate', u'intoDate', u'labelID', u'labelName', u'isPositive', u'labelValue', u'insertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tickerSymbol': 'str','labelName': 'str','labelValue': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ResDyResAuthorGet(authorID, field = "", pandas = "1"):
    """
    记录机构ID、机构名称、研究员头像、研究员姓名、研究员ID、执照ID、电话、邮箱、荣誉、来源、创建时间、更新时间、证书取得日期、证书有效截止日期、学历、岗位、证书状态、更新人、是否是新财富分析师、信息来源。
    
    :param authorID: 研究员ID
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResDyResAuthor.csv?ispandas=1&') 
    if not isinstance(authorID, str) and not isinstance(authorID, unicode):
        authorID = str(authorID)

    requestString.append("authorID=%s"%(authorID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ResDyResAuthorGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ResDyResAuthorGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'orgID', u'orgName', u'authorPhoto', u'authorName', u'authorID', u'certificateID', u'tele', u'email', u'pirze', u'source', u'createTime', u'updateTime', u'cerstartDate', u'cerendDate', u'education', u'position', u'cerStatus', u'updateBy', u'isnewforture', u'nfosource']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'orgName': 'str','authorPhoto': 'str','authorName': 'str','certificateID': 'str','tele': 'str','email': 'str','pirze': 'str','education': 'str','position': 'str','cerStatus': 'str','updateBy': 'str','nfosource': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ResDyResAuthorReportRelGet(authorID = "", reportID = "", field = "", pandas = "1"):
    """
    记录自增主键、研究员ID、研报ID、研究员履历ID、创建时间、更新时间。
    
    :param authorID: 研究员ID,authorID、reportID至少选择一个
    :param reportID: 研报ID,authorID、reportID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResDyResAuthorReportRel.csv?ispandas=1&') 
    if not isinstance(authorID, str) and not isinstance(authorID, unicode):
        authorID = str(authorID)

    requestString.append("authorID=%s"%(authorID))
    if not isinstance(reportID, str) and not isinstance(reportID, unicode):
        reportID = str(reportID)

    requestString.append("&reportID=%s"%(reportID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ResDyResAuthorReportRelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ResDyResAuthorReportRelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'authorID', u'reportID', u'authorResumeID', u'createTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ResConSecIncomeGet(secCode = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    记录证券代码、报告预测时间、预测年度、营业收入预测类型、一致预期营业收入。
    
    :param secCode: 证券代码,secCode、endDate、beginDate至少选择一个
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,secCode、endDate、beginDate至少选择一个
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”,secCode、endDate、beginDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResConSecIncome.csv?ispandas=1&') 
    if not isinstance(secCode, str) and not isinstance(secCode, unicode):
        secCode = str(secCode)

    requestString.append("secCode=%s"%(secCode))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(beginDate, str) and not isinstance(beginDate, unicode):
        beginDate = str(beginDate)

    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ResConSecIncomeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ResConSecIncomeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secCode', u'repForeTime', u'foreYear', u'conIncomeType', u'conIncome']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secCode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ResConSecDataGet(secCode = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    记录证券代码、证券名称、证券类型、报告预测时间、EPS预测类型、净利润预测类型、预测年度、预测报告类型、一致预期EPS、一致预期归属母公司净利润、一致预期PE、一致预期ROE、一致预期净资产、一致预期PB。
    
    :param secCode: 证券代码,secCode、endDate、beginDate至少选择一个
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,secCode、endDate、beginDate至少选择一个
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”,secCode、endDate、beginDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResConSecData.csv?ispandas=1&') 
    if not isinstance(secCode, str) and not isinstance(secCode, unicode):
        secCode = str(secCode)

    requestString.append("secCode=%s"%(secCode))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ResConSecDataGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ResConSecDataGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secCode', u'secName', u'secType', u'repForeTime', u'ConEpsType', u'ConProfitType', u'foreYear', u'foreType', u'conEPS', u'conProfit', u'conPE', u'conROE', u'conNA', u'conPB']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secCode': 'str','secName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ResConTarpriScoreGet(secCode = "", endDate = "", beginDate = "", field = "", pandas = "1"):
    """
    记录证券代码、证券名称、报告预测时间、一致预期目标价、目标价预测类型、一致预期评级、评级预测类型。
    
    :param secCode: 证券代码,secCode、endDate、beginDate至少选择一个
    :param endDate: 截止日期，所查询的数据结束时间，输入格式“YYYYMMDD”,secCode、endDate、beginDate至少选择一个
    :param beginDate: 开始日期，所查询的数据起始时间，输入格式“YYYYMMDD”,secCode、endDate、beginDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/researchReport/getResConTarpriScore.csv?ispandas=1&') 
    if not isinstance(secCode, str) and not isinstance(secCode, unicode):
        secCode = str(secCode)

    requestString.append("secCode=%s"%(secCode))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ResConTarpriScoreGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ResConTarpriScoreGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secCode', u'secName', u'repForeTime', u'conTarPrice', u'conTarPricType', u'conScore', u'conScoreType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secCode': 'str','secName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsContentGet(newsID, field = "", pandas = "1"):
    """
    包含新闻全文等信息。输入新闻ID，获取新闻全文相关字段，如：新闻ID、标题、摘要、正文、来源链接、初始来源、作者、发布来源、发布时间、入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsID: 新闻ID，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsContent.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsContentGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsContentGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsBody', u'newsURL', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsBody': 'str','newsURL': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsContentByTimeGet(newsPublishDate, beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取某天某一段时间内的新闻全文等信息。输入新闻发布的日期、起止时间，获取该时间段内的新闻全文等信息，如：新闻ID、标题、摘要、正文、来源链接、初始来源、作者、发布来源、发布时间、入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsPublishDate: 新闻发布日期，单值输入，输入格式“YYYYMMDD”
    :param beginTime: 查询新闻发布开始时间，格式为HH:MM，如 09:30,可空
    :param endTime: 查询新闻发布结束时间，格式为HH:MM，如 09:30,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsContentByTime.csv?ispandas=1&') 
    try:
        newsPublishDate = newsPublishDate.strftime('%Y%m%d')
    except:
        newsPublishDate = newsPublishDate.replace('-', '')
    requestString.append("newsPublishDate=%s"%(newsPublishDate))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsContentByTimeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsContentByTimeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsBody', u'newsURL', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsBody': 'str','newsURL': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __CompanyByNewsGet(newsID, field = "", pandas = "1"):
    """
    包含新闻关联的公司数据，同时可获取针对不同公司的新闻情感数据。输入新闻ID，获取相关的公司信息，如：公司代码、公司全称，同时返回新闻标题、发布时间、入库时间信息。其中，公司代码可继续通过证券编码及基本上市信息(getSecID)查找公司相关的证券。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsID: 新闻ID，可多值输入，可由DataAPI.NewsInfoByTimeGet(获取一天某段时间内的新闻信息)这个API中获取新闻ID,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getCompanyByNews.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__CompanyByNewsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__CompanyByNewsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'partyID', u'partyFullName', u'relatedScore', u'sentiment', u'sentimentScore', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','partyFullName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsByCompanyGet(partyID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含公司关联的新闻数据，同时可获取针对不同公司的新闻情感数据。输入公司代码、查询的新闻发布起止时间，获取相关的新闻信息，如：新闻ID、新闻标题、发布来源、发布时间、新闻入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param partyID: 公司代码(通联自编)，可先通过证券编码及基本上市信息(DataAPI.SecIDGet)这个API查找公司代码,可以是列表
    :param beginDate: 查询新闻发布开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询新闻发布结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsByCompany.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsByCompanyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsByCompanyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'partyFullName', u'newsID', u'newsTitle', u'relatedScore', u'sentiment', u'sentimentScore', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyFullName': 'str','newsTitle': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __TickersByNewsGet(newsID, field = "", pandas = "1"):
    """
    包含新闻相关的证券数据，同时可获取针对不同证券的新闻情感数据。输入新闻ID，获取相关的证券信息，如：证券代码、证券简称、证券交易场所，同时返回新闻标题、发布来源、发布时间、入库时间等新闻相关信息。每天更新。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsID: 新闻ID，可多值输入，可由DataAPI.NewsInfoByTimeGet(获取一天某段时间内的新闻信息)这个API中获取新闻ID,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTickersByNews.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__TickersByNewsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__TickersByNewsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'exchangeName', u'relatedScore', u'sentiment', u'sentimentScore', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','exchangeName': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsByTickersGet(ticker = "", secShortName = "", secID = "", beginDate = "", endDate = "", exchangeCD = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻数据，同时可获取针对不同证券的新闻情感数据。输入证券代码或简称、查询的新闻发布起止时间，同时可输入证券交易所代码，获取相关新闻数据，如：新闻ID、新闻标题、发布来源、发布时间、入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,ticker、secShortName、secID至少选择一个
    :param secShortName: 证券简称，支持模糊查询,ticker、secShortName、secID至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到，可多值输入，如："000001.XSHE"、"000001.XSHE,600001.XSHG",可以是列表,ticker、secShortName、secID至少选择一个
    :param beginDate: 查询新闻发布开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询新闻发布结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG、XNYS。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所，XNYS表示纽约证券交易所。可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsByTickers.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsByTickersGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsByTickersGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsID', u'newsTitle', u'relatedScore', u'sentiment', u'sentimentScore', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str','newsTitle': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsHeatIndexGet(beginDate = "", endDate = "", exchangeCD = "", ticker = "", secShortName = "", secID = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻热度指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻热度指数(即证券当天关联新闻数量占当天新闻总量的百分比(%))。每天更新。（注：1、2014/1/1起新闻来源众多、指数统计有效，2013年及之前的网站来源不全、数据波动大，数据自2004/10/28始；2、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；3、数据按日更新。)
    
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param secShortName: 证券简称，支持模糊查询,可空
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到，可多值输入，如："000001.XSHE"、"000001.XSHE,600001.XSHG",可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsHeatIndex.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsHeatIndexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsHeatIndexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsPublishDate', u'heatIndex', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsSentimentIndexGet(beginDate = "", endDate = "", exchangeCD = "", ticker = "", secShortName = "", secID = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻情感指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻情感指数(即当天证券关联新闻的情感均值)。（注：1、2014/1/1起新闻来源众多、指数统计有效，2013年及之前的网站来源不全、数据波动大，数据自2004/10/28始；2、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；3、数据按日更新。)
    
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param secShortName: 证券简称，支持模糊查询,可空
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到，可多值输入，如："000001.XSHE"、"000001.XSHE,600001.XSHG",可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsSentimentIndex.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsSentimentIndexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsSentimentIndexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsPublishDate', u'sentimentIndex', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsContentByInsertTimeGet(newsInsertDate, beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取某天某一段时间内入库的新闻全文等信息。输入新闻入库的日期、起止时间，获取该时间段内新入库的新闻全文等信息，如：新闻ID、标题、摘要、正文、来源链接、初始来源、作者、发布来源、发布时间、新闻入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsInsertDate: 新闻入库日期，单值输入，输入格式“YYYYMMDD”
    :param beginTime: 查询新闻入库开始时间，格式为HH:MM，如 09:30,可空
    :param endTime: 查询新闻入库结束时间，格式为HH:MM，如 09:30,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsContentByInsertTime.csv?ispandas=1&') 
    try:
        newsInsertDate = newsInsertDate.strftime('%Y%m%d')
    except:
        newsInsertDate = newsInsertDate.replace('-', '')
    requestString.append("newsInsertDate=%s"%(newsInsertDate))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsContentByInsertTimeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsContentByInsertTimeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsBody', u'newsURL', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsBody': 'str','newsURL': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SocialThemeDataGubaGet(beginDate = "", endDate = "", themeID = "", field = "", pandas = "1"):
    """
    包含主题在股吧社交中的热度统计数据，输入一个或多个主题代码、统计起止日期，获取该主题在一段时间内每天相关的股吧帖子数量、帖子占比(%)。(注：数据自2014/1/1始，按日更新。)
    
    :param beginDate: 统计开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 统计结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param themeID: 主题代码，可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialThemeDataGuba.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SocialThemeDataGubaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SocialThemeDataGubaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'statisticsDate', u'postNum', u'postPercent', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsInfoByTimeRrpGet(newsPublishDate, beginTime = "", endTime = "", newsClassification = "", field = "", pandas = "1"):
    """
    获取某天某一段时间内的新闻基本信息。输入新闻发布的日期、起止时间，同时可输入要查询的新闻类别，获取该时间段内的新闻相关信息，如：新闻ID、标题、摘要、分组代码、初始来源、作者、发布来源、发布时间、入库时间、新闻类别等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsPublishDate: 新闻发布开始日期，单值输入，输入格式“YYYYMMDD”
    :param beginTime: 查询新闻发布开始时间，格式为HH:MM，如 09:30,可空
    :param endTime: 查询新闻发布结束时间，格式为HH:MM，如 09:30,可空
    :param newsClassification: 新闻类别，1为宏观新闻，2为产经新闻，可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfoByTimeRrp.csv?ispandas=1&') 
    try:
        newsPublishDate = newsPublishDate.strftime('%Y%m%d')
    except:
        newsPublishDate = newsPublishDate.replace('-', '')
    requestString.append("newsPublishDate=%s"%(newsPublishDate))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&newsClassification=")
    if hasattr(newsClassification,'__iter__') and not isinstance(newsClassification, str):
        if len(newsClassification) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsClassification
            requestString.append(None)
        else:
            requestString.append(','.join(newsClassification))
    else:
        requestString.append(newsClassification)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsInfoByTimeRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsInfoByTimeRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsURL', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime', u'newsClassification', u'groupID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsURL': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AnnouncementByTimeRrpGet(scannedBeginTime, scannedEndTime, field = "", pandas = "1"):
    """
    获取沪深交易所一段时间内发布的公告数据，输入程序扫描到公告的起止时间，获取公告分类等相关信息，如：公告ID、公告自动分类、扫描时间、下载时间、公告发布日期、公告链接、公告年份、入库时间、更新时间等。(注：公告分类数据自2009/1/5始，按日更新)
    
    :param scannedBeginTime: 查询公告扫描开始时间，单值输入，格式为：YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524
    :param scannedEndTime: 查询公告扫描结束时间，单值输入，格式为：YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAnnouncementByTimeRrp.csv?ispandas=1&') 
    if not isinstance(scannedBeginTime, str) and not isinstance(scannedBeginTime, unicode):
        scannedBeginTime = str(scannedBeginTime)

    requestString.append("scannedBeginTime=%s"%(scannedBeginTime))
    if not isinstance(scannedEndTime, str) and not isinstance(scannedEndTime, unicode):
        scannedEndTime = str(scannedEndTime)

    requestString.append("&scannedEndTime=%s"%(scannedEndTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AnnouncementByTimeRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AnnouncementByTimeRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'annID', u'articleId', u'autoCategory', u'autoUpdatedTime', u'qaCategory', u'qaUpdatedDate', u'subTitle', u'downloadTime', u'scannedTime', u'publishDate', u'ticker', u'URL', u'year', u'fullName', u's3Address', u'insertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'autoCategory': 'str','qaCategory': 'str','subTitle': 'str','ticker': 'str','URL': 'str','fullName': 'str','s3Address': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AnnouncementByAnnIDRrpGet(annID = "", field = "", pandas = "1"):
    """
    根据公告ID获取公告数据，输入公告ID，获取公告分类等相关信息，如：公告ID、公告自动分类、扫描时间、下载时间、公告发布日期、公告链接、公告年份、入库时间、更新时间等。(注：公告分类数据自2009/1/5始，按日更新)
    
    :param annID: 公告ID,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAnnouncementByAnnIDRrp.csv?ispandas=1&') 
    requestString.append("annID=")
    if hasattr(annID,'__iter__') and not isinstance(annID, str):
        if len(annID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = annID
            requestString.append(None)
        else:
            requestString.append(','.join(annID))
    else:
        requestString.append(annID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AnnouncementByAnnIDRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AnnouncementByAnnIDRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'annID', u'title', u'articleId', u'autoCategory', u'autoUpdatedTime', u'qaCategory', u'qaUpdatedDate', u'subTitle', u'downloadTime', u'scannedTime', u'publishDate', u'ticker', u'URL', u'year', u'fullName', u's3Address', u's3HtmlAddress', u'zsAutoCategory', u'reportSize', u'insertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'title': 'str','autoCategory': 'str','qaCategory': 'str','subTitle': 'str','ticker': 'str','URL': 'str','fullName': 'str','s3Address': 'str','s3HtmlAddress': 'str','zsAutoCategory': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AnnouncementNumByTimeRrpGet(scannedBeginTime, scannedEndTime, field = "", pandas = "1"):
    """
    获取一段时间内的公告数，输入公告扫描到的起止时间，获取该时间段内的公告数量。
    
    :param scannedBeginTime: 查询公告扫描开始时间，单值输入，格式为：YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524
    :param scannedEndTime: 查询公告扫描结束时间，单值输入，格式为：YYYY-MM-DD HH:MM:SS 、YYYY-MM-DDTHH:mm:SS或 YYYYMMDDHHMMSS，如：2015-02-26 18:05:24、2015-02-26T18:05:24或20150226180524
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAnnouncementNumByTimeRrp.csv?ispandas=1&') 
    if not isinstance(scannedBeginTime, str) and not isinstance(scannedBeginTime, unicode):
        scannedBeginTime = str(scannedBeginTime)

    requestString.append("scannedBeginTime=%s"%(scannedBeginTime))
    if not isinstance(scannedEndTime, str) and not isinstance(scannedEndTime, unicode):
        scannedEndTime = str(scannedEndTime)

    requestString.append("&scannedEndTime=%s"%(scannedEndTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AnnouncementNumByTimeRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AnnouncementNumByTimeRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'annNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AnnouncementCategoryRrpGet(field = "", pandas = "1"):
    """
    获取所有公告类别，输入参数为空可返回所有公告类别。
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAnnouncementCategoryRrp.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AnnouncementCategoryRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AnnouncementCategoryRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'qaCategory']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'qaCategory': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __TickerNewsSentimentIndexGet(beginDate = "", endDate = "", ticker = "", field = "", pandas = "1"):
    """
    包含股票相关的新闻情感指数数据，输入一个或多个证券交易代码、起止日期，获取该股票一段时间内的新闻情感指数(即股票当天关联到的正面新闻数量占该股票当天关联新闻总量的百分比(%))。每天实时刷新。
    
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTickerNewsSentimentIndex.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__TickerNewsSentimentIndexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__TickerNewsSentimentIndexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'statisticsDate', u'newsHeatIndex', u'newsNum', u'newsNumPositive', u'newsNumNeutral', u'newsNumNegative', u'newsSentimentIndex', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __TickerSocialHeatIndexGet(beginDate = "", endDate = "", ticker = "", field = "", pandas = "1"):
    """
    包含股票相关的新闻社交热度指数数据，输入一个或多个证券交易代码、起止日期，获取该股票在一段时间内的社交热度(即该股票在股吧和雪球中的占比均值)、5日社交热度均值、5日均值变化率等。每天10点左右更新前一天的数据。
    
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTickerSocialHeatIndex.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__TickerSocialHeatIndexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__TickerSocialHeatIndexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'statisticsDate', u'socialHeatIndex', u'ma5', u'ma5Change', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __TickerSocialHeatGet(beginDate = "", endDate = "", ticker = "", field = "", pandas = "1"):
    """
    包含股票相关的新闻社交热度数据，输入一个或多个证券交易代码、起止日期，获取该股票在一段时间内的社交热度统计数据，包括每天该股票在雪球和股吧的帖子数量、帖子数量5日均值及帖子数量变化率等。每天10点左右更新前一天的数据。
    
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTickerSocialHeat.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__TickerSocialHeatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__TickerSocialHeatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'statisticsDate', u'xueqiuPostNum', u'xueqiuPostNumChange', u'xueqiuMa5', u'xueqiuMa5Change', u'gubaPostNum', u'gubaPostNumChange', u'gubaMa5', u'gubaMa5Change', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsInfoRrpGet(newsID, field = "", pandas = "1"):
    """
    包含新闻基本信息。输入新闻ID，获取新闻全文相关字段，如：新闻ID、标题、摘要、来源链接、初始来源、作者、发布来源、发布时间、入库时间等。
    
    :param newsID: 新闻ID，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfoRrp.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsInfoRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsInfoRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsURL', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsURL': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsBodyAllGet(newsID, field = "", pandas = "1"):
    """
    包含新闻全文信息，输入新闻ID，获取新闻全文。
    
    :param newsID: 新闻ID，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsBodyAll.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsBodyAllGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsBodyAllGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsURL', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime', u'effectiveTime', u's3URL']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsURL': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str','s3URL': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsInfoAllGet(newsID, field = "", pandas = "1"):
    """
    包含新闻基本信息。输入新闻ID，获取新闻全文相关字段，如：新闻ID、标题、来源链接、初始来源、作者、发布来源、发布时间、入库时间等。
    
    :param newsID: 新闻ID，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfoAll.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsInfoAllGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsInfoAllGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsBody']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsBody': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsSummaryAllGet(newsID, field = "", pandas = "1"):
    """
    包含新闻摘要信息，输入新闻ID，获取新闻摘要相关信息。
    
    :param newsID: 新闻ID，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsSummaryAll.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsSummaryAllGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsSummaryAllGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsSummary', u'newsClassification']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsSummary': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsInfoIndustryGet(newsID, field = "", pandas = "1"):
    """
    包含新闻基本信息，输入新闻ID，获取新闻相关字段，如：新闻ID、标题、来源链接、初始来源、行业分类等。
    
    :param newsID: 新闻ID，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfoIndustry.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsInfoIndustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsInfoIndustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsClassification', u'effectiveTime', u'newsTitle', u'newsURL', u'newsPublishSite', u'industryName1', u'industryName2']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsURL': 'str','newsPublishSite': 'str','industryName1': 'str','industryName2': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NewsIDGet(effectiveDate, importantScore, field = "", pandas = "1"):
    """
    通过生效时间及重要分数获取新闻ID，包含新闻ID、新闻生效时间、新闻重要分数。
    
    :param effectiveDate: 新闻有效时间
    :param importantScore: 新闻重要分数
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsID.csv?ispandas=1&') 
    try:
        effectiveDate = effectiveDate.strftime('%Y%m%d')
    except:
        effectiveDate = effectiveDate.replace('-', '')
    requestString.append("effectiveDate=%s"%(effectiveDate))
    if not isinstance(importantScore, str) and not isinstance(importantScore, unicode):
        importantScore = str(importantScore)

    requestString.append("&importantScore=%s"%(importantScore))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NewsIDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NewsIDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AnncProfGet(reportID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取公告利好利空信息，包含公告ID、公告发布时间、公告分类、利好利空等。
    
    :param reportID: 公告ID,可以是列表,reportID、ticker至少选择一个
    :param ticker: 证券交易代码，证券在交易所的通用代码,可以是列表,reportID、ticker至少选择一个
    :param beginDate: 公告发布起始时间,可以是列表,可空
    :param endDate: 公告发布结束时间,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAnncProf.csv?ispandas=1&') 
    requestString.append("reportID=")
    if hasattr(reportID,'__iter__') and not isinstance(reportID, str):
        if len(reportID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportID
            requestString.append(None)
        else:
            requestString.append(','.join(reportID))
    else:
        requestString.append(reportID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&beginDate=")
    if hasattr(beginDate,'__iter__') and not isinstance(beginDate, str):
        if len(beginDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = beginDate
            requestString.append(None)
        else:
            requestString.append(','.join(beginDate))
    else:
        requestString.append(beginDate)
    requestString.append("&endDate=")
    if hasattr(endDate,'__iter__') and not isinstance(endDate, str):
        if len(endDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = endDate
            requestString.append(None)
        else:
            requestString.append(','.join(endDate))
    else:
        requestString.append(endDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AnncProfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AnncProfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'scannedTime', u'publishDate', u'ticker', u'zsAutoCategory', u'profitability']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','zsAutoCategory': 'str','profitability': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AnncProfbyTickerGet(ticker, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    根据证券代码或发布时间，获取公告ID、公告分类、公告摘要、公告利好利空等信息。
    
    :param ticker: 股票交易代码，如600000,可以是列表
    :param beginDate: 起始时间，格式为yyyymmdd,可空
    :param endDate: 截止时间，格式为yyyymmdd,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAnncProfbyTicker.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AnncProfbyTickerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AnncProfbyTickerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'zsAutoCategory', u'abstract', u'publishDate', u'ticker', u'profitability']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'zsAutoCategory': 'str','abstract': 'str','ticker': 'str','profitability': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MonitorShareChangesGet(beginDate, ticker = "", secShortName = "", holderName = "", changeType = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司股东增减持情况。
    
    :param beginDate: 变动日期
    :param ticker: 股票代码,ticker、secShortName、holderName、changeType至少选择一个
    :param secShortName: 股票简称,ticker、secShortName、holderName、changeType至少选择一个
    :param holderName: 股东名称,ticker、secShortName、holderName、changeType至少选择一个
    :param changeType: 股东类型，1表示高管，2表示股东，0表示都是,ticker、secShortName、holderName、changeType至少选择一个
    :param endDate: 变动日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getMonitorShareChanges.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    if not isinstance(holderName, str) and not isinstance(holderName, unicode):
        holderName = str(holderName)

    requestString.append("&holderName=%s"%(holderName))
    if not isinstance(changeType, str) and not isinstance(changeType, unicode):
        changeType = str(changeType)

    requestString.append("&changeType=%s"%(changeType))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MonitorShareChangesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MonitorShareChangesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'managerName', u'position', u'holderName', u'relation', u'shareHoldBf', u'shareChanges', u'shareHoldAf', u'shareHoldPntAf', u'changeProp', u'avgPrice', u'changeReason', u'changeType', u'changeDate', u'fillDate', u'contentID', u'actDate', u'changeDir', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','managerName': 'str','position': 'str','holderName': 'str','relation': 'str','changeReason': 'str','changeDir': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SocialDataXQGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    包含系列2社交统计数据，输入一个或多个证券交易代码、统计起止日期，获取该证券一段时间内每天的系列2中帖子数量、帖子占比(%)。
    
    :param ticker: 证券交易代码，可多值输入,可以是列表,可空
    :param beginDate: 统计开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 统计结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialDataXQ.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SocialDataXQGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SocialDataXQGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'statisticsDate', u'postNum', u'postPercent', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SocialDataXQByTickerGet(ticker, field = "", pandas = "1"):
    """
    包含按单只证券代码获取的系列2社交数据，输入一个证券交易代码，获取该证券每天的系列2中帖子数量、及帖子占比(%)。
    
    :param ticker: 证券交易代码，单值输入
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialDataXQByTicker.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SocialDataXQByTickerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SocialDataXQByTickerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'statisticsDate', u'postNum', u'postPercent', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SocialDataXQByDateGet(statisticsDate, field = "", pandas = "1"):
    """
    包含按单个统计日期获取的系列2社交数据，输入一个统计日期，获取当天系列2中帖子涉及的所有证券、各证券系列2中帖子数量、帖子占比(%)。
    
    :param statisticsDate: 统计日期，单值输入，输入格式“YYYYMMDD”
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialDataXQByDate.csv?ispandas=1&') 
    try:
        statisticsDate = statisticsDate.strftime('%Y%m%d')
    except:
        statisticsDate = statisticsDate.replace('-', '')
    requestString.append("statisticsDate=%s"%(statisticsDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SocialDataXQByDateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SocialDataXQByDateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'statisticsDate', u'postNum', u'postPercent', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsInfoGet(newsID, field = "", pandas = "1"):
    """
    输入新闻ID，获取新闻基本信息，如：新闻ID、标题、摘要、初始来源、作者、发布来源、发布时间、入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、每天新闻数据量少；2、数据实时更新。)
    
    :param newsID: 新闻ID，可多值输入。新闻ID可通过接口getNewsInfoByInsertTime获取。,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfo.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsInfoByTimeGet(newsBeginDate, newsEndDate, beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取某天某一段时间内的新闻基本信息。输入新闻发布的日期、起止时间，获取该时间段内的新闻相关信息，如：新闻ID、标题、摘要、初始来源、作者、发布来源、发布时间、入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsBeginDate: 新闻发布日期起始，单值输入，输入格式“YYYYMMDD”
    :param newsEndDate: 新闻发布日期截止，单值输入，输入格式“YYYYMMDD”
    :param beginTime: 查询新闻发布开始时间，格式为HH:MM，如 09:30,可空
    :param endTime: 查询新闻发布结束时间，格式为HH:MM，如 09:30,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfoByTime.csv?ispandas=1&') 
    try:
        newsBeginDate = newsBeginDate.strftime('%Y%m%d')
    except:
        newsBeginDate = newsBeginDate.replace('-', '')
    requestString.append("newsBeginDate=%s"%(newsBeginDate))
    try:
        newsEndDate = newsEndDate.strftime('%Y%m%d')
    except:
        newsEndDate = newsEndDate.replace('-', '')
    requestString.append("&newsEndDate=%s"%(newsEndDate))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsInfoByTimeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsInfoByTimeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ReportByTickerGet(ticker, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    根据证券代码获取相应公告分类结果，输入一个或多个证券交易代码，可以获取所查询证券相关的公告信息，包括公告ID、公告名称、证券交易场所、证券交易所对公告的原始分类、公告分类结果、公告分类入库时间、更新时间。(注：公告分类数据自2009/1/5始，按日更新)
    
    :param ticker: 证券交易代码，可输入一个或多个，用","分隔，如"000001"、"000001,600001"。（可多值输入）,可以是列表
    :param beginDate: 查询开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getReportByTicker.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ReportByTickerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ReportByTickerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'publishDate', u'tiker', u'title', u'year', u'site', u'reportType', u'Category', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tiker': 'str','title': 'str','site': 'str','reportType': 'str','Category': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ReportByCategoryGet(beginDate = "", endDate = "", Category = "", scanTimeB = "", scanTimeE = "", field = "", pandas = "1"):
    """
    根据公告分类获取相应公告信息，输入一个或多个公告分类，可以获取所查询证券相关的公告信息，包括公告ID、公告名称、证券交易场所、证券交易所对公告的原始分类、公告发布时间、公告所属分类、公告分类入库时间、更新时间。(注：公告分类数据自2009/1/5始，按日更新)
    
    :param beginDate: 查询开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param Category: 公告自动分类，支持关键词模糊查询，单值输入。分类包括：业绩报告、招股说明书、招股意向书受限股上市、股权收购、要约收购、吸收合并、增发预案、增发获准、诉讼仲裁、高管变动、债券相关、政府补贴、违纪违规、担保事项、项目投资、股价异动、其他等等。,可空
    :param scanTimeB: 自动分类数据扫描时间起始查询,可空
    :param scanTimeE: 自动分类数据扫描时间截止查询,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getReportByCategory.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(Category, str) and not isinstance(Category, unicode):
        Category = str(Category)

    requestString.append("&Category=%s"%(Category))
    try:
        scanTimeB = scanTimeB.strftime('%Y%m%d')
    except:
        scanTimeB = scanTimeB.replace('-', '')
    requestString.append("&scanTimeB=%s"%(scanTimeB))
    try:
        scanTimeE = scanTimeE.strftime('%Y%m%d')
    except:
        scanTimeE = scanTimeE.replace('-', '')
    requestString.append("&scanTimeE=%s"%(scanTimeE))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ReportByCategoryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ReportByCategoryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'publishDate', u'category', u'ticker', u'title', u'year', u'site', u'reportType', u'insertTime', u'updateTime', u'scanTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'category': 'str','ticker': 'str','title': 'str','site': 'str','reportType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ReportContentGet(ticker, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    根据证券代码获取公告内容，输入一个或多个证券交易代码，可以获取所查询证券相关的公告信息，包括公告ID、公告名称、证券交易场所、证券交易所对公告的原始分类、公告发布时间、公告具体内容、公告链接、公告入库时间。(注：公告数据自2000/1/8始，按日更新)
    
    :param ticker: 证券交易代码，可输入一个或多个，用","分隔，如"000001"、"000001,600001"。（可多值输入）,可以是列表
    :param beginDate: 查询开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getReportContent.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ReportContentGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ReportContentGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'publishDate', u'ticker', u'title', u'year', u'site', u'reportType', u'txtContent', u'URL', u'insertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','title': 'str','site': 'str','reportType': 'str','txtContent': 'str','URL': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsInfoByInsertTimeGet(newsInsertDate, beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取某天某一段时间内入库的新闻基本信息。输入新闻入库的日期、起止时间，获取该时间段内新入库的新闻相关信息，如：新闻ID、标题、摘要、初始来源、作者、发布来源、发布时间、新闻入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsInsertDate: 新闻开始入库日期，单值输入，输入格式“YYYYMMDD”
    :param beginTime: 查询新闻入库开始时间，格式为HH:MM，如 09:30,可空
    :param endTime: 查询新闻入库结束时间，格式为HH:MM，如 09:30,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfoByInsertTime.csv?ispandas=1&') 
    try:
        newsInsertDate = newsInsertDate.strftime('%Y%m%d')
    except:
        newsInsertDate = newsInsertDate.replace('-', '')
    requestString.append("newsInsertDate=%s"%(newsInsertDate))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsInfoByInsertTimeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsInfoByInsertTimeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SocialDataGubaGet(beginDate = "", endDate = "", ticker = "", field = "", pandas = "1"):
    """
    包含证券在系列1社交中的热度统计数据，输入一个或多个证券交易代码、统计起止日期，该证券在一段时间内每天相关的系列1中帖子数量、帖子占比(%)。(注：数据自2014/1/1始，按日更新。)
    
    :param beginDate: 统计开始日期，默认为30天前，输入格式“YYYYMMDD”,可空
    :param endDate: 统计结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param ticker: 证券交易代码，可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialDataGuba.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SocialDataGubaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SocialDataGubaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'statisticsDate', u'postNum', u'postPercent', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ReportContentByIDGet(reportID, field = "", pandas = "1"):
    """
    根据公告ID获取公告原始内容数据，输入公告ID，获取公告原文等信息，包括公告ID、公告名称、证券交易场所、证券交易所对公告的原始分类、公告发布时间、公告具体内容、公告链接、公告入库时间。(注：公告数据自2000/1/8始，按日更新)
    
    :param reportID: 公告代码,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getReportContentByID.csv?ispandas=1&') 
    requestString.append("reportID=")
    if hasattr(reportID,'__iter__') and not isinstance(reportID, str):
        if len(reportID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportID
            requestString.append(None)
        else:
            requestString.append(','.join(reportID))
    else:
        requestString.append(reportID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ReportContentByIDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ReportContentByIDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'publishDate', u'tiker', u'title', u'year', u'site', u'reportType', u'txtContent', u'URL', u'insertTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tiker': 'str','title': 'str','site': 'str','reportType': 'str','txtContent': 'str','URL': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsBodyGet(newsID, field = "", pandas = "1"):
    """
    包含新闻全文信息，输入新闻ID，获取新闻全文、新闻链接等。(注：1、自2014/1/1起新闻来源众多、新闻量日均2万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsID: 新闻ID，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsBody.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsBodyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsBodyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsBody', u'newsURL']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsBody': 'str','newsURL': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsInfoByTimeAndSiteGet(newsPublishDate, beginTime = "", endTime = "", newsPublishSite = "", pageTag = "", field = "", pandas = "1"):
    """
    分新闻源获取一天某段时间内的新闻信息，该API为未经去重处理的新闻数据。可先在获取新闻发布来源列表(getNewsPublishSite)API中获取通联的新闻源列表。输入新闻发布的日期、起止时间、新闻发布来源，获取该时间段内的新闻相关信息，如：新闻ID、标题、摘要、初始来源、作者、发布来源、发布时间、入库时间等。(注：1、自2014/1/1起新闻来源众多、新闻量日均4万左右，2013年及之前的网站来源少、新闻数据量少；2、数据实时更新。)
    
    :param newsPublishDate: 新闻发布日期，输入格式“YYYYMMDD”
    :param beginTime: 查询新闻发布开始时间，格式为HH:MM，如 09:30,可空
    :param endTime: 查询新闻发布结束时间，格式为HH:MM，如 09:30,可空
    :param newsPublishSite: 新闻发布来源，即新闻的实际最终来源,可在获取新闻发布来源列表(DataAPI.NewsPublishSiteGet)API中获取通联的新闻源列表,可空
    :param pageTag: 新闻源页面标签，爬取的新闻源的新闻分类标签，目前只适用于newsPublishSite='和讯网'的新闻，所涉及的类别为：互联网金融,保险,信托,债券,公益,养老金,创投,商学院,商旅,国债期货,基金,外汇,奢侈品,房产,收藏,新闻,期货,汽车,现货,理财,科技,税务,股指期货,股票,舆情,评论,读书,银行,黄金。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfoByTimeAndSite.csv?ispandas=1&') 
    try:
        newsPublishDate = newsPublishDate.strftime('%Y%m%d')
    except:
        newsPublishDate = newsPublishDate.replace('-', '')
    requestString.append("newsPublishDate=%s"%(newsPublishDate))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(newsPublishSite, str) and not isinstance(newsPublishSite, unicode):
        newsPublishSite = str(newsPublishSite)

    requestString.append("&newsPublishSite=%s"%(newsPublishSite))
    requestString.append("&pageTag=")
    if hasattr(pageTag,'__iter__') and not isinstance(pageTag, str):
        if len(pageTag) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = pageTag
            requestString.append(None)
        else:
            requestString.append(','.join(pageTag))
    else:
        requestString.append(pageTag)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsInfoByTimeAndSiteGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsInfoByTimeAndSiteGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsSummary', u'newsOriginSource', u'newsAuthor', u'newsPublishSite', u'newsPublishTime', u'newsInsertTime', u'pageTag']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsSummary': 'str','newsOriginSource': 'str','newsAuthor': 'str','newsPublishSite': 'str','pageTag': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsPublishSiteGet(field = "", pandas = "1"):
    """
    获取新闻发布来源列表，输入参数为空、直接获取通联新闻数据的爬取来源列表（数据基本保持日度更新）。
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsPublishSite.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsPublishSiteGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsPublishSiteGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsPublishSite']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsPublishSite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IndexBaiduGet(currDate = "", keyword = "", field = "", pandas = "1"):
    """
    获取标的词汇的热度数据，即标的词汇在网络中的搜索变动趋势。
    
    :param currDate: 数据日期,格式为"YYYYMMDD",currDate、keyword至少选择一个
    :param keyword: 关键词名称,可以是列表,currDate、keyword至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getIndexBaidu.csv?ispandas=1&') 
    try:
        currDate = currDate.strftime('%Y%m%d')
    except:
        currDate = currDate.replace('-', '')
    requestString.append("currDate=%s"%(currDate))
    requestString.append("&keyword=")
    if hasattr(keyword,'__iter__') and not isinstance(keyword, str):
        if len(keyword) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = keyword
            requestString.append(None)
        else:
            requestString.append(','.join(keyword))
    else:
        requestString.append(keyword)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IndexBaiduGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IndexBaiduGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'currDate', u'keyword', u'indexValue', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'keyword': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsHeatIndexV2Get(beginDate = "", endDate = "", secID = "", exchangeCD = "", ticker = "", secShortName = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻热度指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻热度指数(即证券当天关联新闻数量占当天新闻总量的百分比(%))。每天更新。（注：1、2014/1/1起新闻来源众多、指数统计有效，2013年及之前的网站来源不全、数据波动大，数据自2004/10/28始；2、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；3、数据按日更新。)
    
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到，可多值输入，如："000001.XSHE"、"000001.XSHE,600001.XSHG",可以是列表,可空
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param secShortName: 证券简称，支持模糊查询,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsHeatIndexV2.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsHeatIndexV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsHeatIndexV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsPublishDate', u'heatIndex', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsSentimentIndexV2Get(beginDate = "", endDate = "", secID = "", exchangeCD = "", ticker = "", secShortName = "", field = "", pandas = "1"):
    """
    包含证券相关的新闻情感指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻情感指数(即当天证券关联新闻的情感均值)。（注：1、2014/1/1起新闻来源众多、指数统计有效，2013年及之前的网站来源不全、数据波动大，数据自2004/10/28始；2、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；3、数据按日更新。)
    
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,可空
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,可空
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到，可多值输入，如："000001.XSHE"、"000001.XSHE,600001.XSHG",可以是列表,可空
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,可空
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,可空
    :param secShortName: 证券简称，支持模糊查询,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsSentimentIndexV2.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsSentimentIndexV2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsSentimentIndexV2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsPublishDate', u'sentimentIndex', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TkgThemesGet(themeID = "", themeName = "", field = "", pandas = "1"):
    """
    获取主题基本信息。包含主题ID、主题名称、别名、主题描述、主题最近的驱动事件等信息。
    
    :param themeID: 主题ID,可以是列表,可空
    :param themeName: 主题名称，支持模糊查询,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTkgThemes.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    if not isinstance(themeName, str) and not isinstance(themeName, unicode):
        themeName = str(themeName)

    requestString.append("&themeName=%s"%(themeName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TkgThemesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TkgThemesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'themeAlias', u'themeDesc', u'event', u'insertTime', u'updateTime', u'isIndustry']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str','themeAlias': 'str','themeDesc': 'str','event': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TkgThemeTickerRelGet(themeID = "", secID = "", ticker = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取主题与证券关联关系信息。包含主题ID、证券内部编码、证券交易代码、证券简称、关联度等信息。
    
    :param themeID: 主题ID，主题基本信息可从getTkgThemes中获得,可以是列表,themeID、secID、ticker至少选择一个
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。,可以是列表,themeID、secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,themeID、secID、ticker至少选择一个
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTkgThemeTickerRel.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TkgThemeTickerRelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TkgThemeTickerRelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'secID', u'ticker', u'secShortName', u'secFullName', u'exchangeCD', u'score', u'relDesc', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','secFullName': 'str','exchangeCD': 'str','relDesc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TkgThemeHotGet(beginDate = "", endDate = "", themeID = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取主题热度数据。包含主题ID、主题名称、整体热度分数、主题关联新闻数量、用主题词搜索新闻匹配的数量、计算热度的时间等信息。
    
    :param beginDate: 热度生效起始日期，格式为“YYYYMMDD”,可空
    :param endDate: 热度生效结束日期，格式为“YYYYMMDD”或者“YYYYMMDDHHMMSS”,可空
    :param themeID: 主题ID，主题基本信息可从getTkgThemes中获得,可以是列表,可空
    :param beginTime: 热度生效起始时间，格式为“YYYYMMDDHHMMSS”,可空
    :param endTime: 热度生效截止时间，格式为“YYYYMMDDHHMMSS”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTkgThemeHot.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TkgThemeHotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TkgThemeHotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'hotScore', u'newsThemeMatchCnt', u'newsThemeMatchChgPct', u'newsSearchCnt', u'effectiveTime', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TkgThemeNewsRelGet(themeID = "", newsID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取新闻与主题关联信息。包含主题ID、主题名称、新闻ID、新闻标题、新闻有效发布时间、关联度等信息。
    
    :param themeID: 主题ID，主题基本信息可从getTkgThemes中获得,可以是列表,themeID、newsID至少选择一个
    :param newsID: 新闻ID，新闻基本信息可从getNewsInfo中获得,可以是列表,themeID、newsID至少选择一个
    :param beginDate: 新闻发布起始时间，格式为“YYYYMMDD”,可空
    :param endDate: 新闻发布结束时间，格式为“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTkgThemeNewsRel.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    requestString.append("&newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TkgThemeNewsRelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TkgThemeNewsRelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsEffectiveTime', u'themeID', u'themeName', u'score', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TkgThemeMarketGet(beginDate, endDate, themeID = "", field = "", pandas = "1"):
    """
    获取主题市场指数。包含主题ID、交易日、当日市值、市场指数、与上一个交易日的市值变动比例等信息。
    
    :param beginDate: 交易起始日期，输入格式“YYYYMMDD”
    :param endDate: 交易截止日期，输入格式“YYYYMMDD”
    :param themeID: 主题ID，主题基本信息可从getTkgThemes中获得,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTkgThemeMarket.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TkgThemeMarketGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TkgThemeMarketGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'tradeDate', u'marketValue', u'marketIndex', u'chgPct', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoMofPppGet(beginDate, projName = "", province = "", prefecture = "", endDate = "", field = "", pandas = "1"):
    """
    国家财政部PPP示范项目情况。包含项目名称、所属区域、所属行业、项目介绍、项目金额、实施阶段、合作期限、运作方式等
    
    :param beginDate: 项目发起日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param projName: 项目名称,projName、province、prefecture至少选择一个
    :param province: 项目所属省份,projName、province、prefecture至少选择一个
    :param prefecture: 项目所属地市,projName、province、prefecture至少选择一个
    :param endDate: 截止时间,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getEcoMofPpp.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(projName, str) and not isinstance(projName, unicode):
        projName = str(projName)

    requestString.append("&projName=%s"%(projName))
    if not isinstance(province, str) and not isinstance(province, unicode):
        province = str(province)

    requestString.append("&province=%s"%(province))
    if not isinstance(prefecture, str) and not isinstance(prefecture, unicode):
        prefecture = str(prefecture)

    requestString.append("&prefecture=%s"%(prefecture))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoMofPppGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoMofPppGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'projName', u'province', u'prefecture', u'county', u'sector', u'subSector', u'projAmt', u'projStat', u'coopPd', u'projOm', u'retMech', u'pubDate', u'pubType', u'projDesc', u'projLev', u'projBatch']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'projName': 'str','province': 'str','prefecture': 'str','county': 'str','sector': 'str','subSector': 'str','projStat': 'str','projOm': 'str','retMech': 'str','pubType': 'str','projDesc': 'str','projLev': 'str','projBatch': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoNdrcPppGet(beginDate, projName = "", projRegion = "", endDate = "", field = "", pandas = "1"):
    """
    国家发改委PPP推介项目概况。包括项目名称、所属区域、所属行业、项目金额、建设内容等信息。
    
    :param beginDate: 项目发起日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param projName: 项目名称,projName、projRegion至少选择一个
    :param projRegion: 项目所属省份,projName、projRegion至少选择一个
    :param endDate: 截止时间,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getEcoNdrcPpp.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(projName, str) and not isinstance(projName, unicode):
        projName = str(projName)

    requestString.append("&projName=%s"%(projName))
    if not isinstance(projRegion, str) and not isinstance(projRegion, unicode):
        projRegion = str(projRegion)

    requestString.append("&projRegion=%s"%(projRegion))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoNdrcPppGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoNdrcPppGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'promBatch', u'projRegion', u'projName', u'projSec', u'projSubSec', u'projLoc', u'projDesc', u'projAmt', u'projStat', u'govPrtpMdl', u'pppMdl', u'publishDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'promBatch': 'str','projRegion': 'str','projName': 'str','projSec': 'str','projSubSec': 'str','projLoc': 'str','projDesc': 'str','projStat': 'str','govPrtpMdl': 'str','pppMdl': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjWebgamesGet(beginDate, gameName = "", developCompany = "", endDate = "", field = "", pandas = "1"):
    """
    记录网页各种游戏的信息，包含游戏名称、游戏模式、开发公司、游戏状态、画面方式、战斗方式、画面风格、游戏题材、开服总数（组）。
    
    :param beginDate: 项目发起日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param gameName: 游戏名称,gameName、developCompany至少选择一个
    :param developCompany: 开发公司,gameName、developCompany至少选择一个
    :param endDate: 截止时间,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjWebgames.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(gameName, str) and not isinstance(gameName, unicode):
        gameName = str(gameName)

    requestString.append("&gameName=%s"%(gameName))
    if not isinstance(developCompany, str) and not isinstance(developCompany, unicode):
        developCompany = str(developCompany)

    requestString.append("&developCompany=%s"%(developCompany))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjWebgamesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjWebgamesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'gameName', u'gameMode', u'developCompany', u'gameState', u'screenMode', u'battleMode', u'screenStyle', u'gameTheme', u'totalOpenService']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'gameName': 'str','gameMode': 'str','developCompany': 'str','gameState': 'str','screenMode': 'str','battleMode': 'str','screenStyle': 'str','gameTheme': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjNifdcbioGet(beginDate, endDate = "", drugName = "", field = "", pandas = "1"):
    """
    记录中国食品药品检定研究院的生物制品批签发数据，包含年份、制品名称、规格、批号、批量/进口量、批量/进口量单位、有效期至、生产企业、检品编号、批签发证号、报告书编号、签发日期、签发结论。
    
    :param beginDate: 项目发起日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param endDate: 截止时间,可空
    :param drugName: 制品名称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjNifdcbio.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(drugName, str) and not isinstance(drugName, unicode):
        drugName = str(drugName)

    requestString.append("&drugName=%s"%(drugName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjNifdcbioGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjNifdcbioGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'years', u'drugName', u'format', u'approval', u'impAmount', u'impUnit', u'validDate', u'producCo', u'inspectNum', u'approveLicense', u'reportNum', u'issueDate', u'issueConclusion']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'years': 'str','drugName': 'str','format': 'str','approval': 'str','impUnit': 'str','producCo': 'str','inspectNum': 'str','approveLicense': 'str','reportNum': 'str','issueConclusion': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjCdeDrugGet(beginDate, endDate = "", drugName = "", field = "", pandas = "1"):
    """
    描述各种药品在国家食品药监局受理和在审的情况，包含药品类型、申请类型、受理号、药品名称和企业名称等。
    
    :param beginDate: 项目发起日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param endDate: 截止时间,可空
    :param drugName: 制品名称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjCdeDrug.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(drugName, str) and not isinstance(drugName, unicode):
        drugName = str(drugName)

    requestString.append("&drugName=%s"%(drugName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjCdeDrugGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjCdeDrugGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'acceptNO', u'drugName', u'drugType', u'applyType', u'statusStatus', u'dataDate', u'rgstNo', u'partyName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'acceptNO': 'str','drugName': 'str','drugType': 'str','applyType': 'str','statusStatus': 'str','rgstNo': 'str','partyName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjCdeDrugStatGet(indication = "", field = "", pandas = "1"):
    """
    描述国家食品药监局已有批准文号和在审品种的信息，包含适应症、主要化合物、已批注射数、已批非注射数、在审注射数、在审非注射数和合计等情况。
    
    :param indication: 适应症,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjCdeDrugStat.csv?ispandas=1&') 
    if not isinstance(indication, str) and not isinstance(indication, unicode):
        indication = str(indication)

    requestString.append("indication=%s"%(indication))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjCdeDrugStatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjCdeDrugStatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'indication', u'mainCompnd', u'injApprv', u'nonInjApprv', u'injProcsd', u'nonInjProcsd', u'count']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'indication': 'str','mainCompnd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjCdeDrugPriorGet(beginDate, endDate = "", drugName = "", field = "", pandas = "1"):
    """
    描述国家食品药品监督管理局优先审评公示，其中包含拟优先审评品种公示和纳入优先审评品种名单，涉及受理号、药品名称、注册申请人、承办日期、公示日期、公示截止日期和类型。
    
    :param beginDate: 项目发起日期，所查询的数据起始时间，输入格式“YYYYMMDD”
    :param endDate: 截止时间,可空
    :param drugName: 药品名称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjCdeDrugPrior.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(drugName, str) and not isinstance(drugName, unicode):
        drugName = str(drugName)

    requestString.append("&drugName=%s"%(drugName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjCdeDrugPriorGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjCdeDrugPriorGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'acceptNO', u'drugName', u'applicant', u'undertakeDate', u'publishDate', u'publishEndDate', u'type']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'acceptNO': 'str','drugName': 'str','applicant': 'str','type': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def DaasPersonCompanyGet(companyName = "", regNO = "", field = "", pandas = "1"):
    """
    企业工商信息，包含企业信息、经营范围、企业状态、法人、股东及出资占比等
    
    :param companyName: 企业机构名称,companyName、regNO至少选择一个
    :param regNO: 注册号,companyName、regNO至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getDaasPersonCompany.csv?ispandas=1&') 
    if not isinstance(companyName, str) and not isinstance(companyName, unicode):
        companyName = str(companyName)

    requestString.append("companyName=%s"%(companyName))
    if not isinstance(regNO, str) and not isinstance(regNO, unicode):
        regNO = str(regNO)

    requestString.append("&regNO=%s"%(regNO))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'DaasPersonCompanyGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'DaasPersonCompanyGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'companyName', u'regNO', u'companyType', u'personName', u'isLegPerson', u'isHolder', u'conRatio', u'conAmount', u'establishDate', u'regCapital', u'regOrg', u'companyStatus', u'dom', u'opScope', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'companyName': 'str','regNO': 'str','companyType': 'str','personName': 'str','regOrg': 'str','companyStatus': 'str','dom': 'str','opScope': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjP2pPlatGet(beginDate, endDate, platName = "", field = "", pandas = "1"):
    """
    记录各平台数据，包含成交额、综合利率、投资人、借款周期、借款人、满标速度、累计贷款余额和资金净流入。
    
    :param beginDate: 起始日期
    :param endDate: 截止日期
    :param platName: 平台名称,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjP2pPlat.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&platName=")
    if hasattr(platName,'__iter__') and not isinstance(platName, str):
        if len(platName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = platName
            requestString.append(None)
        else:
            requestString.append(','.join(platName))
    else:
        requestString.append(platName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjP2pPlatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjP2pPlatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'platName', u'endDate', u'turnover', u'compInteRate', u'investor', u'loanPeriod', u'borrower', u'fullScaleSpeed', u'accuLoanBalance', u'netCapitalInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'platName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjP2pDealGet(beginDate, endDate, field = "", pandas = "1"):
    """
    记录行业成交明细数据，包含成交额、综合利率、平均借贷期限、累计贷款余额和资金净流入。
    
    :param beginDate: 起始日期
    :param endDate: 截止日期
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjP2pDeal.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjP2pDealGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjP2pDealGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'endDate', u'turnover', u'compInteRate', u'avgLendPeriod', u'accuLoanBalance', u'netCapitalInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjP2pQuantGet(beginDate, endDate, field = "", pandas = "1"):
    """
    记录行业平台数量明细数据，包含新增平台、累计平台总数、新增问题平台、累计问题平台总数和淘汰率。
    
    :param beginDate: 起始日期
    :param endDate: 截止日期
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjP2pQuant.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjP2pQuantGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjP2pQuantGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'endDate', u'newPlat', u'accuPlat', u'newProblemPlat', u'accuProblemPlat', u'outRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjInvestApprovalGet(beginDate, endDate, investorType = "", investorNameCN = "", investorNameEN = "", regAddress = "", trusteeBank = "", field = "", pandas = "1"):
    """
    投资者额度审批数据（其中包括合格境内投资者、合格境外机构投资者、人民币合格境外机构投资者的投资额度）。
    
    :param beginDate: 起始日期
    :param endDate: 截止日期
    :param investorType: 投资者类型，包括QDII、QFII、RQFII。,可以是列表,可空
    :param investorNameCN: 机构中文名称,可以是列表,可空
    :param investorNameEN: 机构英文名称,可以是列表,可空
    :param regAddress: 注册地,可以是列表,可空
    :param trusteeBank: 托管银行,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjInvestApproval.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&investorType=")
    if hasattr(investorType,'__iter__') and not isinstance(investorType, str):
        if len(investorType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = investorType
            requestString.append(None)
        else:
            requestString.append(','.join(investorType))
    else:
        requestString.append(investorType)
    requestString.append("&investorNameCN=")
    if hasattr(investorNameCN,'__iter__') and not isinstance(investorNameCN, str):
        if len(investorNameCN) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = investorNameCN
            requestString.append(None)
        else:
            requestString.append(','.join(investorNameCN))
    else:
        requestString.append(investorNameCN)
    requestString.append("&investorNameEN=")
    if hasattr(investorNameEN,'__iter__') and not isinstance(investorNameEN, str):
        if len(investorNameEN) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = investorNameEN
            requestString.append(None)
        else:
            requestString.append(','.join(investorNameEN))
    else:
        requestString.append(investorNameEN)
    requestString.append("&regAddress=")
    if hasattr(regAddress,'__iter__') and not isinstance(regAddress, str):
        if len(regAddress) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = regAddress
            requestString.append(None)
        else:
            requestString.append(','.join(regAddress))
    else:
        requestString.append(regAddress)
    requestString.append("&trusteeBank=")
    if hasattr(trusteeBank,'__iter__') and not isinstance(trusteeBank, str):
        if len(trusteeBank) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = trusteeBank
            requestString.append(None)
        else:
            requestString.append(','.join(trusteeBank))
    else:
        requestString.append(trusteeBank)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjInvestApprovalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjInvestApprovalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'investorType', u'investorNameCN', u'investorNameEN', u'regAddress', u'trusteeBank', u'approveDate', u'totalApproveAmt', u'unit', u'endDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'investorType': 'str','investorNameCN': 'str','investorNameEN': 'str','regAddress': 'str','trusteeBank': 'str','unit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def VecoRankCeGet(beginDate, endDate, rankObject = "", field = "", pandas = "1"):
    """
    中国企业500强榜单，包含排名、营业收入。
    
    :param beginDate: 开始日期
    :param endDate: 结束日期
    :param rankObject: 企业名称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getVecoRankCe.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(rankObject, str) and not isinstance(rankObject, unicode):
        rankObject = str(rankObject)

    requestString.append("&rankObject=%s"%(rankObject))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'VecoRankCeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'VecoRankCeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'year', u'rankNO', u'rankObject', u'dataValue', u'rankType', u'dataPeriod']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'rankObject': 'str','rankType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def VecoRankCeServiceGet(beginDate, endDate, rankObject = "", field = "", pandas = "1"):
    """
    中国服务业企业500强榜单，包含排名、营业收入。
    
    :param beginDate: 开始日期
    :param endDate: 结束日期
    :param rankObject: 企业名称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getVecoRankCeService.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(rankObject, str) and not isinstance(rankObject, unicode):
        rankObject = str(rankObject)

    requestString.append("&rankObject=%s"%(rankObject))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'VecoRankCeServiceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'VecoRankCeServiceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'year', u'rankNO', u'rankObject', u'dataValue', u'rankType', u'dataPeriod']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'rankObject': 'str','rankType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def VecoRankCeMfgGet(beginDate, endDate, rankObject = "", field = "", pandas = "1"):
    """
    中国制造业企业500强榜单，包含排名、营业收入。
    
    :param beginDate: 开始日期
    :param endDate: 结束日期
    :param rankObject: 企业名称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getVecoRankCeMfg.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(rankObject, str) and not isinstance(rankObject, unicode):
        rankObject = str(rankObject)

    requestString.append("&rankObject=%s"%(rankObject))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'VecoRankCeMfgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'VecoRankCeMfgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'year', u'rankNO', u'rankObject', u'dataValue', u'rankType', u'dataPeriod']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'rankObject': 'str','rankType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsRelatedScoreGet(beginDate, endDate, assetClass, newsID = "", secID = "", ticker = "", partyID = "", equType = "", field = "", pandas = "1"):
    """
    获取新闻关联的公司、证券情感分数信息，包含新闻ID、关联公司ID、关联证券代码、新闻发布时间、新闻情感分数等信息
    
    :param beginDate: 新闻发布查询起始时间，格式为YYYYMMDD
    :param endDate: 新闻发布查询截止时间，格式为YYYYMMDD
    :param assetClass: 通联编制的证券类别编码。例如，E-股票；B-债券；F-基金；FU-期货等。对应DataAPI.SysCodeGet.codeTypeID=10001。
    :param newsID: 新闻ID，可通过DataAPI.NewsInfoByTimeGet获取,可以是列表,newsID、secID、ticker、partyID、equType至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,newsID、secID、ticker、partyID、equType至少选择一个
    :param ticker: 证券在交易市场的交易代码,newsID、secID、ticker、partyID、equType至少选择一个
    :param partyID: 机构内部ID，可通过DataAPI.PartyIDGet获取,newsID、secID、ticker、partyID、equType至少选择一个
    :param equType: 此处可填写“A”-A股或“B”-B股,newsID、secID、ticker、partyID、equType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsRelatedScore.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("&secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    if not isinstance(partyID, str) and not isinstance(partyID, unicode):
        partyID = str(partyID)

    requestString.append("&partyID=%s"%(partyID))
    if not isinstance(equType, str) and not isinstance(equType, unicode):
        equType = str(equType)

    requestString.append("&equType=%s"%(equType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsRelatedScoreGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsRelatedScoreGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'secID', u'equType', u'assetClass', u'ticker', u'secShortName', u'exchangeCD', u'partyID', u'newsPublishTime', u'newsInsertTime', u'degreeProp1St', u'degreeProp2St', u'relatedCompanyDegree', u'relatedCompanyScore', u'sentiment', u'sentimentScore']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','equType': 'str','assetClass': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ReportInfoGet(beginDate = "", endDate = "", ticker = "", site = "", field = "", pandas = "1"):
    """
    获取公告基础信息，包含公告下载时间、公告发布日期、公告属性、公告来源等。
    
    :param beginDate: 发布起始日期，格式为YYYYMMDD,beginDate、endDate、ticker、site至少选择一个
    :param endDate: 发布截止日期，格式为YYYYMMDD,beginDate、endDate、ticker、site至少选择一个
    :param ticker: 证券交易代码,beginDate、endDate、ticker、site至少选择一个
    :param site: 发布源,beginDate、endDate、ticker、site至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getReportInfo.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    if not isinstance(site, str) and not isinstance(site, unicode):
        site = str(site)

    requestString.append("&site=%s"%(site))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ReportInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ReportInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'site', u'title', u'url', u'year', u'type', u'reportType', u'fundCode', u'reportSize', u'publishDate', u'downloadTime', u'scannedTime', u'createTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','site': 'str','title': 'str','url': 'str','reportType': 'str','fundCode': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ReportAbstractGet(beginDate = "", endDate = "", ticker = "", reportID = "", field = "", pandas = "1"):
    """
    获取公告摘要信息，包含公告ID、公告标题、公告浙商分类、公告首次出现时间、公告摘要信息等
    
    :param beginDate: 发布起始日期，格式为YYYYMMDD,beginDate、endDate、ticker、reportID至少选择一个
    :param endDate: 发布截止日期，格式为YYYYMMDD,beginDate、endDate、ticker、reportID至少选择一个
    :param ticker: 证券交易代码,beginDate、endDate、ticker、reportID至少选择一个
    :param reportID: 公告ID，可根据getReportInfo获取,beginDate、endDate、ticker、reportID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getReportAbstract.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    if not isinstance(reportID, str) and not isinstance(reportID, unicode):
        reportID = str(reportID)

    requestString.append("&reportID=%s"%(reportID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ReportAbstractGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ReportAbstractGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'title', u'scannedTime', u'publishDate', u'ticker', u'zsAutoCategory', u'abstract', u'abstractType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'title': 'str','ticker': 'str','zsAutoCategory': 'str','abstract': 'str','abstractType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def AnnouncementGet(ticker = "", reportID = "", zsAutoCategory = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取公告分类信息，包含公告ID、公告发布时间、公告分类、公告类型等信息。
    
    :param ticker: 证券交易代码,ticker、reportID、zsAutoCategory至少选择一个
    :param reportID: 公告ID,可以是列表,ticker、reportID、zsAutoCategory至少选择一个
    :param zsAutoCategory: 浙商分类,ticker、reportID、zsAutoCategory至少选择一个
    :param beginDate: 起始日期，发布时间查询开始日期，格式为YYYYMMDD,可空
    :param endDate: 截止日期，发布时间查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAnnouncement.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    requestString.append("&reportID=")
    if hasattr(reportID,'__iter__') and not isinstance(reportID, str):
        if len(reportID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportID
            requestString.append(None)
        else:
            requestString.append(','.join(reportID))
    else:
        requestString.append(reportID)
    if not isinstance(zsAutoCategory, str) and not isinstance(zsAutoCategory, unicode):
        zsAutoCategory = str(zsAutoCategory)

    requestString.append("&zsAutoCategory=%s"%(zsAutoCategory))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'AnnouncementGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'AnnouncementGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'publishDate', u'autoCategory', u'zsAutoCategory', u'ticker', u'isImportant', u'title', u'year', u'site', u'reportType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'autoCategory': 'str','zsAutoCategory': 'str','ticker': 'str','title': 'str','site': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def AnnoProfitabilityGet(ticker = "", reportID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取公告利好利空信息，包含公告ID、股票代码、公告利好利空标志等信息
    
    :param ticker: 证券交易代码,ticker、reportID至少选择一个
    :param reportID: 公告ID,可以是列表,ticker、reportID至少选择一个
    :param beginDate: 起始日期，发布时间查询开始日期，格式为YYYYMMDD,可空
    :param endDate: 截止日期，发布时间查询截止日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAnnoProfitability.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    requestString.append("&reportID=")
    if hasattr(reportID,'__iter__') and not isinstance(reportID, str):
        if len(reportID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportID
            requestString.append(None)
        else:
            requestString.append(','.join(reportID))
    else:
        requestString.append(reportID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'AnnoProfitabilityGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'AnnoProfitabilityGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportID', u'scannedTime', u'publishDate', u'ticker', u'zsAutoCategory', u'profitablity']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','zsAutoCategory': 'str','profitablity': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TkgThemeSecCntGet(beginDate = "", endDate = "", themeID = "", secID = "", ticker = "", field = "", pandas = "1"):
    """
    获取日度主题与个股关联分数，包含新闻总数、新闻关联度、证券代码等信息
    
    :param beginDate: 起始日期，格式为YYYYMMDD,beginDate、endDate、themeID、secID、ticker至少选择一个
    :param endDate: 截止日期，格式为YYYYMMDD,beginDate、endDate、themeID、secID、ticker至少选择一个
    :param themeID: 主题ID，可根据getTkgThemes获取,beginDate、endDate、themeID、secID、ticker至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,beginDate、endDate、themeID、secID、ticker至少选择一个
    :param ticker: 证券交易代码,beginDate、endDate、themeID、secID、ticker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getTkgThemeSecCnt.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(themeID, str) and not isinstance(themeID, unicode):
        themeID = str(themeID)

    requestString.append("&themeID=%s"%(themeID))
    if not isinstance(secID, str) and not isinstance(secID, unicode):
        secID = str(secID)

    requestString.append("&secID=%s"%(secID))
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("&ticker=%s"%(ticker))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TkgThemeSecCntGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TkgThemeSecCntGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'statDate', u'themeID', u'secID', u'ticker', u'secShortName', u'exchangeCD', u'score', u'countNews', u'scoreNews', u'countRpt', u'scoreRpt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbEquAllotGet(ticker = "", publishDate = "", beginDate = "", endDate = "", listDate = "", field = "", pandas = "1"):
    """
    记录配股信息，包括股票代码、配股价、实际配股数量、预案公告日、股东大会公告日、除权日等。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、publishDate、beginDate、endDate、listDate至少选择一个
    :param publishDate: 预案公告日，输入格式“YYYYMMDD”,可以是列表,ticker、publishDate、beginDate、endDate、listDate至少选择一个
    :param beginDate: 按除权日查询的起始日期，输入格式“YYYYMMDD”,ticker、publishDate、beginDate、endDate、listDate至少选择一个
    :param endDate: 按除权日查询的截止日期，输入格式“YYYYMMDD”,ticker、publishDate、beginDate、endDate、listDate至少选择一个
    :param listDate: 配股上市日，输入格式“YYYYMMDD”,可以是列表,ticker、publishDate、beginDate、endDate、listDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbEquAllot.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&publishDate=")
    if hasattr(publishDate,'__iter__') and not isinstance(publishDate, str):
        if len(publishDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = publishDate
            requestString.append(None)
        else:
            requestString.append(','.join(publishDate))
    else:
        requestString.append(publishDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&listDate=")
    if hasattr(listDate,'__iter__') and not isinstance(listDate, str):
        if len(listDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = listDate
            requestString.append(None)
        else:
            requestString.append(','.join(listDate))
    else:
        requestString.append(listDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbEquAllotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbEquAllotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShorTname', u'allotmentPrice', u'allotShares', u'sharesBFallot', u'sharesAFallot', u'publishDate', u'shcPublishDate', u'iecPublishDate', u'csrcPublishDate', u'recordDate', u'exrightsDate', u'listDate', u'preplaShareNum', u'allotmentRatio', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShorTname': 'str','allotmentPrice': 'str','allotShares': 'str','sharesBFallot': 'str','sharesAFallot': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbEqueBoardPubGet(ticker = "", partyID = "", annoID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录董事会信息，包括机构代码、实际披露时间、交易代码、议案类型、议案名称等。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、partyID、annoID、beginDate、endDate至少选择一个
    :param partyID: 机构代码,可以是列表,ticker、partyID、annoID、beginDate、endDate至少选择一个
    :param annoID: 公告ID,可以是列表,ticker、partyID、annoID、beginDate、endDate至少选择一个
    :param beginDate: 根据会议日期查询的起始日期，输入格式“YYYYMMDD”,ticker、partyID、annoID、beginDate、endDate至少选择一个
    :param endDate: 根据会议日期查询的截止日期，输入格式“YYYYMMDD”,ticker、partyID、annoID、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbEqueBoardPub.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&annoID=")
    if hasattr(annoID,'__iter__') and not isinstance(annoID, str):
        if len(annoID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = annoID
            requestString.append(None)
        else:
            requestString.append(','.join(annoID))
    else:
        requestString.append(annoID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbEqueBoardPubGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbEqueBoardPubGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyId', u'actPubTime', u'ticker', u'secShortName', u'exchangeCd', u'infoSource', u'annoId', u'meetDate', u'propType', u'propName', u'meetLocation', u'recordId', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','exchangeCd': 'str','infoSource': 'str','propType': 'str','propName': 'str','meetLocation': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbEquDivGet(ticker = "", publishDate = "", beginDate = "", endDate = "", divDate = "", cashDate = "", field = "", pandas = "1"):
    """
    记录股票分红送转信息，包括预案内容、实施进展情况、股利支付率、分红率等。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、publishDate、beginDate、endDate、divDate、cashDate至少选择一个
    :param publishDate: 预案公告日，输入格式“YYYYMMDD”,可以是列表,ticker、publishDate、beginDate、endDate、divDate、cashDate至少选择一个
    :param beginDate: 按报告期查询的起始日期，输入格式“YYYYMMDD”,ticker、publishDate、beginDate、endDate、divDate、cashDate至少选择一个
    :param endDate: 按报告期查询的截止日期，输入格式“YYYYMMDD”,ticker、publishDate、beginDate、endDate、divDate、cashDate至少选择一个
    :param divDate: A股除权除息日,可以是列表,ticker、publishDate、beginDate、endDate、divDate、cashDate至少选择一个
    :param cashDate: A股派息日,可以是列表,ticker、publishDate、beginDate、endDate、divDate、cashDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbEquDiv.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&publishDate=")
    if hasattr(publishDate,'__iter__') and not isinstance(publishDate, str):
        if len(publishDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = publishDate
            requestString.append(None)
        else:
            requestString.append(','.join(publishDate))
    else:
        requestString.append(publishDate)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&divDate=")
    if hasattr(divDate,'__iter__') and not isinstance(divDate, str):
        if len(divDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = divDate
            requestString.append(None)
        else:
            requestString.append(','.join(divDate))
    else:
        requestString.append(divDate)
    requestString.append("&cashDate=")
    if hasattr(cashDate,'__iter__') and not isinstance(cashDate, str):
        if len(cashDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = cashDate
            requestString.append(None)
        else:
            requestString.append(','.join(cashDate))
    else:
        requestString.append(cashDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbEquDivGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbEquDivGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'publishDate', u'endDate', u'shcPublishDate', u'imPublishDate', u'transRatio', u'divRatio', u'cashDiv', u'recordDate', u'divDate', u'cashDate', u'profitPnt', u'bonusPnt', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','transRatio': 'str','divRatio': 'str','cashDiv': 'str','profitPnt': 'str','bonusPnt': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbEquSpoGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录股票增发方案内容与进度情况。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、beginDate、endDate至少选择一个
    :param beginDate: 按预案公告日查询的起始日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param endDate: 按预案公告日查询的截止日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbEquSpo.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbEquSpoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbEquSpoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'eventProcedure', u'issuePrice', u'issueVol', u'changePercent', u'sniProceeds', u'advanceDate', u'smDeciPublDate', u'sasacApprovalDate', u'csrcApprovalDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','eventProcedure': 'str','issuePrice': 'str','issueVol': 'str','changePercent': 'str','sniProceeds': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbFixPerFdmtAsoGet(ticker = "", announcementID = "", beginDate = "", endDate = "", financeID = "", field = "", pandas = "1"):
    """
    记录定期财报信息，包括公告首次出现时间、股票代码、会计期间、营业收入、上一年归属于母公司所有者(或股东)的净利润等。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、announcementID、beginDate、endDate、financeID至少选择一个
    :param announcementID: 公告ID,可以是列表,ticker、announcementID、beginDate、endDate、financeID至少选择一个
    :param beginDate: 按报告期查询的起始日期，输入格式“YYYYMMDD”,ticker、announcementID、beginDate、endDate、financeID至少选择一个
    :param endDate: 按报告期查询的截止日期，输入格式“YYYYMMDD”,ticker、announcementID、beginDate、endDate、financeID至少选择一个
    :param financeID: 财报ID,可以是列表,ticker、announcementID、beginDate、endDate、financeID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbFixPerFdmtAso.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&announcementID=")
    if hasattr(announcementID,'__iter__') and not isinstance(announcementID, str):
        if len(announcementID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = announcementID
            requestString.append(None)
        else:
            requestString.append(','.join(announcementID))
    else:
        requestString.append(announcementID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&financeID=")
    if hasattr(financeID,'__iter__') and not isinstance(financeID, str):
        if len(financeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = financeID
            requestString.append(None)
        else:
            requestString.append(','.join(financeID))
    else:
        requestString.append(financeID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbFixPerFdmtAsoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbFixPerFdmtAsoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'announcementId', u'financeId', u'scannedTime', u'ticker', u'secShortName', u'reportDate', u'fiscalPeriod', u'previousYearRevenue', u'revenue', u'revenueGrowthRatio', u'previousYearOperateProfit', u'operateProfit', u'operateProfitGrowthRatio', u'previousYearIncomeAttr', u'incomeAttr', u'incomeAttrGrowthRatio', u'incomeHomogeneousExpectations', u'incomeExpectedGrowthRatio', u'previousYearIncome', u'income', u'incomeGrowthRatio', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbHelderChgGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录权益变动信息，包括股票代码、变动日期、股东名称、变动原因、变动比例等。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、beginDate、endDate至少选择一个
    :param beginDate: 按变动日期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param endDate: 按变动日期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbHelderChg.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbHelderChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbHelderChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'changeDate', u'holderName', u'changeReason', u'sharePcntChange', u'sharePcntBefore', u'sharePcntAfter', u'operateType', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','holderName': 'str','changeReason': 'str','sharePcntChange': 'str','sharePcntBefore': 'str','sharePcntAfter': 'str','operateType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbHscDatailGet(ticker = "", beginReportDate = "", endReportDate = "", beginChangeDate = "", endChangeDate = "", changeType = "", field = "", pandas = "1"):
    """
    记录重要股东买卖明细情况，包括股票代码、股东名称、关联高管、交易方向、交易均价、交易数量等信息。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、beginReportDate、endReportDate、beginChangeDate、endChangeDate至少选择一个
    :param beginReportDate: 按披露日期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginReportDate、endReportDate、beginChangeDate、endChangeDate至少选择一个
    :param endReportDate: 按披露日期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginReportDate、endReportDate、beginChangeDate、endChangeDate至少选择一个
    :param beginChangeDate: 按变动日期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginReportDate、endReportDate、beginChangeDate、endChangeDate至少选择一个
    :param endChangeDate: 按变动日期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginReportDate、endReportDate、beginChangeDate、endChangeDate至少选择一个
    :param changeType: 变动方向：增持或减持,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbHscDatail.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginReportDate = beginReportDate.strftime('%Y%m%d')
    except:
        beginReportDate = beginReportDate.replace('-', '')
    requestString.append("&beginReportDate=%s"%(beginReportDate))
    try:
        endReportDate = endReportDate.strftime('%Y%m%d')
    except:
        endReportDate = endReportDate.replace('-', '')
    requestString.append("&endReportDate=%s"%(endReportDate))
    try:
        beginChangeDate = beginChangeDate.strftime('%Y%m%d')
    except:
        beginChangeDate = beginChangeDate.replace('-', '')
    requestString.append("&beginChangeDate=%s"%(beginChangeDate))
    try:
        endChangeDate = endChangeDate.strftime('%Y%m%d')
    except:
        endChangeDate = endChangeDate.replace('-', '')
    requestString.append("&endChangeDate=%s"%(endChangeDate))
    if not isinstance(changeType, str) and not isinstance(changeType, unicode):
        changeType = str(changeType)

    requestString.append("&changeType=%s"%(changeType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbHscDatailGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbHscDatailGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'isChgPlan', u'reportDate', u'changeDate', u'holderName', u'seniorName', u'seniorPosition', u'changeType', u'avgPrice', u'shareChanges', u'propChanges', u'marketValue', u'shareHoldAf', u'sharePntAf', u'changeMethod', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','isChgPlan': 'str','holderName': 'str','seniorName': 'str','seniorPosition': 'str','changeType': 'str','avgPrice': 'str','shareChanges': 'str','propChanges': 'str','marketValue': 'str','shareHoldAf': 'str','sharePntAf': 'str','changeMethod': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbHscHistoryGet(beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录重要股东增减持情况，包含披露日期、增减持总市值和增减持公司数等信息。
    
    :param beginDate: 按披露日期查询的起始日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 按披露日期查询的截止日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbHscHistory.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbHscHistoryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbHscHistoryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'reportDate', u'zcNumber', u'jcNumber', u'zcCompany', u'jcCompany', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'zcNumber': 'str','jcNumber': 'str','zcCompany': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbHscTotalGet(ticker = "", beginDate = "", endDate = "", changeType = "", field = "", pandas = "1"):
    """
    记录重要股东买卖总览情况，包括股票简称、交易方向、变动总次数、变动股东数、变动总股数、变动总市值和变动股东明细信息。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、beginDate、endDate至少选择一个
    :param beginDate: 按交易日期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param endDate: 按交易日期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param changeType: 变动方向：增持或减持,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbHscTotal.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(changeType, str) and not isinstance(changeType, unicode):
        changeType = str(changeType)

    requestString.append("&changeType=%s"%(changeType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbHscTotalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbHscTotalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'secShortName', u'changeType', u'changeTimes', u'changeMember', u'avgPrice', u'shareChanges', u'marketValue', u'holderList', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','changeType': 'str','avgPrice': 'str','shareChanges': 'str','marketValue': 'str','holderList': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MajorContractGet(ticker = "", announcementID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录重大合同信息，包括股票代码、项目进度、项目名称、合同金额上限、是否构成关联交易等。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、announcementID、beginDate、endDate至少选择一个
    :param announcementID: 公告ID,可以是列表,ticker、announcementID、beginDate、endDate至少选择一个
    :param beginDate: 按发布日期查询的起始日期，输入格式“YYYYMMDD”,ticker、announcementID、beginDate、endDate至少选择一个
    :param endDate: 按发布日期查询的截止日期，输入格式“YYYYMMDD”,ticker、announcementID、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getMajorContract.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&announcementID=")
    if hasattr(announcementID,'__iter__') and not isinstance(announcementID, str):
        if len(announcementID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = announcementID
            requestString.append(None)
        else:
            requestString.append(','.join(announcementID))
    else:
        requestString.append(announcementID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MajorContractGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MajorContractGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'updateTime', u'ticker', u'secShortName', u'reportProgress', u'projectName', u'contractPartyA', u'contractPartyB', u'contractGrand', u'currencyType', u'biddingAmount', u'operationMode', u'contractEffectiveDate', u'contractDeadline', u'contractTimeLimit', u'isrelatedTransaction', u'membersofUnion', u'relationshipwithPartyB', u'firstPublishDate', u'publishDate', u'announcementId', u'recordId', u'actPubTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','reportProgress': 'str','projectName': 'str','contractPartyA': 'str','contractPartyB': 'str','contractGrand': 'str','currencyType': 'str','biddingAmount': 'str','operationMode': 'str','contractEffectiveDate': 'str','contractDeadline': 'str','contractTimeLimit': 'str','isrelatedTransaction': 'str','membersofUnion': 'str','relationshipwithPartyB': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbPerfNoticeGet(ticker = "", beginPublishDate = "", endPublishDate = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录业绩预告相关信息，包括预告日期、预告类型、预告净利润等数据。（该表只展示一季度、半年、三季度、年度的业绩预告，且展示字段均为‘归母净利润’）
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、beginPublishDate、endPublishDate、beginDate、endDate至少选择一个
    :param beginPublishDate: 按预告日期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginPublishDate、endPublishDate、beginDate、endDate至少选择一个
    :param endPublishDate: 按预告日期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginPublishDate、endPublishDate、beginDate、endDate至少选择一个
    :param beginDate: 按报告期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginPublishDate、endPublishDate、beginDate、endDate至少选择一个
    :param endDate: 按报告期期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginPublishDate、endPublishDate、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/gerRbPerfNotice.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginPublishDate = beginPublishDate.strftime('%Y%m%d')
    except:
        beginPublishDate = beginPublishDate.replace('-', '')
    requestString.append("&beginPublishDate=%s"%(beginPublishDate))
    try:
        endPublishDate = endPublishDate.strftime('%Y%m%d')
    except:
        endPublishDate = endPublishDate.replace('-', '')
    requestString.append("&endPublishDate=%s"%(endPublishDate))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbPerfNoticeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbPerfNoticeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'publishDate', u'endDate', u'reportType', u'expnIncome', u'incomeChgr', u'lastIncome', u'forecastCont', u'updateTime', u'expnIncapUpl', u'expnIncapLl', u'nIncapChgrUpl', u'nIncapChgrLl', u'expRevUpl', u'expRevLl', u'updatetTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','reportType': 'str','expnIncome': 'str','incomeChgr': 'str','lastIncome': 'str','forecastCont': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbSeniorChgGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录高管变化信息，包括股票代码、发布日期、状态、姓名、任职时间等。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、beginDate、endDate至少选择一个
    :param beginDate: 按发布日期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param endDate: 按发布日期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbSeniorChg.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbSeniorChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbSeniorChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'publishDate', u'status', u'manageName', u'position', u'gender', u'nationality', u'education', u'birthday', u'beginDate', u'departureDate', u'backgroudDesc', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','status': 'str','manageName': 'str','position': 'str','gender': 'str','nationality': 'str','education': 'str','birthday': 'str','backgroudDesc': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbShafltCalendarGet(beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录限售股解禁日期与解禁市值信息。
    
    :param beginDate: 按解禁日期查询的起始日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param endDate: 按解禁日期查询的截止日期，输入格式“YYYYMMDD”,beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbShafltCalendar.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbShafltCalendarGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbShafltCalendarGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'floatingdDate', u'marketableValues', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'marketableValues': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbShafltTotalGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录上市公司限售股流通时间与数量，包含股票代码、流通日期、流通数量、流通股份性质等信息。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、beginDate、endDate至少选择一个
    :param beginDate: 按发布日期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param endDate: 按发布日期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbShafltTotal.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbShafltTotalGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbShafltTotalGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'floatingDate', u'newMarketableShares', u'propotionNewOld', u'propotionNewAccu', u'propotionNewTotal', u'shareSource', u'nonMarketableShares', u'floatValue', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','newMarketableShares': 'str','propotionNewOld': 'str','propotionNewAccu': 'str','propotionNewTotal': 'str','shareSource': 'str','nonMarketableShares': 'str','floatValue': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def RbBlockTradingGet(ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录大宗交易信息，包括股票代码、交易日期、成交价、成交量、成交额占比等。
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,ticker、beginDate、endDate至少选择一个
    :param beginDate: 按交易日期查询的起始日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param endDate: 按交易日期查询的截止日期，输入格式“YYYYMMDD”,ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getRbBlockTrading.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'RbBlockTradingGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'RbBlockTradingGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'secShortName', u'tradeDate', u'tradePrice', u'tradeVol', u'tradeVal', u'preCloseRate', u'closeRate', u'tradeValRate', u'buyerBd', u'sellerBd', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','secShortName': 'str','tradePrice': 'str','tradeVol': 'str','tradeVal': 'str','preCloseRate': 'str','closeRate': 'str','tradeValRate': 'str','buyerBd': 'str','sellerBd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjPollutantPermitGet(beginDate, endDate, province = "", city = "", nameCN = "", field = "", pandas = "1"):
    """
    全国企业排污许可,包括申请前信息公开、许可信息公开、许可注销公告、许可撤销公告
    
    :param beginDate: 发证起始日期
    :param endDate: 发证截止日期
    :param province: 省份,可空
    :param city: 城市,可空
    :param nameCN: 企业名称,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjPollutantPermit.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(province, str) and not isinstance(province, unicode):
        province = str(province)

    requestString.append("&province=%s"%(province))
    if not isinstance(city, str) and not isinstance(city, unicode):
        city = str(city)

    requestString.append("&city=%s"%(city))
    if not isinstance(nameCN, str) and not isinstance(nameCN, unicode):
        nameCN = str(nameCN)

    requestString.append("&nameCN=%s"%(nameCN))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjPollutantPermitGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjPollutantPermitGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'type', u'province', u'city', u'licenseNum', u'nameCN', u'industryCategory', u'address', u'beginDate', u'endDate', u'issueDate', u'reason']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'type': 'str','province': 'str','city': 'str','licenseNum': 'str','nameCN': 'str','industryCategory': 'str','address': 'str','reason': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsIndustryGet(newsID = "", field = "", pandas = "1"):
    """
    获取每条新闻关联的行业信息。行业包含：一级行业分类包含32类(申万一级27类(不包含“综合”)和公司stock、宏观marco、债券bond、市场market、其他other）二级行业分类包含27类（申万一级27类，不包含“综合”）；剔除了非财经新闻。
    
    :param newsID: 新闻ID,可多值输入,可以是列表,newsID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsIndustry.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsIndustryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsIndustryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'effectiveTime', u'newsTitle', u'newsURL', u'newsPublishSite', u'industryName1', u'industryName2']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsURL': 'str','newsPublishSite': 'str','industryName1': 'str','industryName2': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsTagbdGet(newsID = "", field = "", pandas = "1"):
    """
    获取涵盖金融市场的新闻属性标签，根据新闻来源、篇幅及其他特点对新闻自动打标签。包括是否是基本面新闻、是否是数据型新闻、是否是政策新闻等信息。
    
    :param newsID: 新闻ID，可多值输入,新闻基本信息可从DataAPI.NewsInfoByTimeGet中获得,可以是列表,newsID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsTagbd.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsTagbdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsTagbdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'isEconom', u'isData', u'isLongNews', u'isProSite', u'isShortNews', u'isMonthData', u'isPolicy', u'isPicture', u'ministry', u'isPeriod', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ministry': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsPolicyClassifGet(newsID, field = "", pandas = "1"):
    """
    获取政策新闻类别划分，及新闻源信息。每条政策对应一个类别。
    
    :param newsID: 政策（新闻）ID,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsPolicyClassif.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsPolicyClassifGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsPolicyClassifGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsIndustry', u'newsSite', u'source', u'newsEffectTime', u'insertTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsIndustry': 'str','newsSite': 'str','source': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EcoDataTruckInfoGet(truckType = "", truckBrand = "", truckSeries = "", truckVersion = "", field = "", pandas = "1"):
    """
    描述包括牵引车、载货车、自卸车、专用车在内的卡车基本信息，其中包含吨位、马力、车型、厂商指导价格（万元）、车辆型号、轴距（mm）、整车自重（KG）、发动机品牌、马力（ps）、变速箱型号、驱动形式、车身长度（mm）、最高车速（km/h）、排量（l）、扭距（n.m）和最大扭矩转速（rpm）等。
    
    :param truckType: 类型,truckType、truckBrand、truckSeries、truckVersion至少选择一个
    :param truckBrand: 品牌,truckType、truckBrand、truckSeries、truckVersion至少选择一个
    :param truckSeries: 车系,truckType、truckBrand、truckSeries、truckVersion至少选择一个
    :param truckVersion: 车型,truckType、truckBrand、truckSeries、truckVersion至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getEcoDataTruckInfo.csv?ispandas=1&') 
    if not isinstance(truckType, str) and not isinstance(truckType, unicode):
        truckType = str(truckType)

    requestString.append("truckType=%s"%(truckType))
    if not isinstance(truckBrand, str) and not isinstance(truckBrand, unicode):
        truckBrand = str(truckBrand)

    requestString.append("&truckBrand=%s"%(truckBrand))
    if not isinstance(truckSeries, str) and not isinstance(truckSeries, unicode):
        truckSeries = str(truckSeries)

    requestString.append("&truckSeries=%s"%(truckSeries))
    if not isinstance(truckVersion, str) and not isinstance(truckVersion, unicode):
        truckVersion = str(truckVersion)

    requestString.append("&truckVersion=%s"%(truckVersion))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EcoDataTruckInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EcoDataTruckInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'truckType', u'truckBrand', u'truckSeries', u'tonnage', u'horsepowerRange', u'truckVersion', u'guidePrice', u'vehicleModel', u'wheelbase', u'vehicleWeight', u'engineBrand', u'horsepower', u'transmissionModel', u'drivingForm', u'bodyLength', u'maxSpeed', u'displacement', u'torque', u'maxTorqueSpeed', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'truckType': 'str','truckBrand': 'str','truckSeries': 'str','tonnage': 'str','horsepowerRange': 'str','truckVersion': 'str','guidePrice': 'str','vehicleModel': 'str','wheelbase': 'str','vehicleWeight': 'str','engineBrand': 'str','horsepower': 'str','transmissionModel': 'str','drivingForm': 'str','bodyLength': 'str','maxSpeed': 'str','displacement': 'str','torque': 'str','maxTorqueSpeed': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjNcarDateGet(beginDate, endDate = "", truckVersion = "", type = "", field = "", pandas = "1"):
    """
    记录新车上市日历，包含上市时间、车型、类别、厂商指导价下限（万）、厂商指导价上限（万）、换代类型。
    
    :param beginDate: 起始日期
    :param endDate: 截止日期,可空
    :param truckVersion: 车型,可空
    :param type: 类别,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjNcarDate.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(truckVersion, str) and not isinstance(truckVersion, unicode):
        truckVersion = str(truckVersion)

    requestString.append("&truckVersion=%s"%(truckVersion))
    if not isinstance(type, str) and not isinstance(type, unicode):
        type = str(type)

    requestString.append("&type=%s"%(type))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjNcarDateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjNcarDateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'truckVersion', u'type', u'guidePriceMin', u'guidePriceMax', u'replaceType', u'memoCn', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'truckVersion': 'str','type': 'str','replaceType': 'str','memoCn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjCarRecallGet(beginDate, endDate = "", comp = "", model = "", modelDet = "", field = "", pandas = "1"):
    """
    记录国家质检总局发布的汽车产品召回公告信息，包括召回类型、国家、发布日期、召回起始日期、召回截止日期、汽车厂商、车系、车型、年度、数量、生产起始日期、生产截止日期、车辆识别号码范围、产品缺陷、后果、处理措施、应急处置方法、改进措施、投诉索赔情况、事故及人员伤亡情况、车主通知方式、其他信息、备注、链接等。
    
    :param beginDate: 发布起始日期
    :param endDate: 发布截止日期,可空
    :param comp: 汽车厂商,可空
    :param model: 车系,可空
    :param modelDet: 车型,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjCarRecall.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(comp, str) and not isinstance(comp, unicode):
        comp = str(comp)

    requestString.append("&comp=%s"%(comp))
    if not isinstance(model, str) and not isinstance(model, unicode):
        model = str(model)

    requestString.append("&model=%s"%(model))
    if not isinstance(modelDet, str) and not isinstance(modelDet, unicode):
        modelDet = str(modelDet)

    requestString.append("&modelDet=%s"%(modelDet))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjCarRecallGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjCarRecallGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'type', u'country', u'publishDate', u'recallBeginDate', u'recallEndDate', u'comp', u'model', u'modelDet', u'year', u'dataValue', u'produceBeginDate', u'produceEndDate', u'vin', u'defect', u'result', u'treatmentMeasures', u'emergencyDisposal', u'improvementMeasures', u'complaintClaims', u'accidentsCasualties', u'informeMethod', u'otherInformation', u'remark']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'type': 'str','country': 'str','comp': 'str','model': 'str','modelDet': 'str','year': 'str','vin': 'str','defect': 'str','result': 'str','treatmentMeasures': 'str','emergencyDisposal': 'str','improvementMeasures': 'str','complaintClaims': 'str','accidentsCasualties': 'str','informeMethod': 'str','otherInformation': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SocialThemeGbByDateGet(tradeDate, field = "", pandas = "1"):
    """
    获取单个日期在系列1中的主题社交数据，输入一个交易日期，获取该交易日期主题社交数据。
    
    :param tradeDate: 统计日期
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialThemeGbByDate.csv?ispandas=1&') 
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SocialThemeGbByDateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SocialThemeGbByDateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'tradeDate', u'postNum', u'postPercent']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjCarIndexGet(beginDate, endDate = "", brand = "", carSeries = "", modelAlias = "", field = "", pandas = "1"):
    """
    记录品牌、车系、车型别名、厂方指导价格、汽车零整比、常用配件指数、保养指数等信息。
    
    :param beginDate: 起始日期
    :param endDate: 截止日期,可空
    :param brand: 品牌,可空
    :param carSeries: 车系,可空
    :param modelAlias: 车型别名,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjCarIndex.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(brand, str) and not isinstance(brand, unicode):
        brand = str(brand)

    requestString.append("&brand=%s"%(brand))
    if not isinstance(carSeries, str) and not isinstance(carSeries, unicode):
        carSeries = str(carSeries)

    requestString.append("&carSeries=%s"%(carSeries))
    if not isinstance(modelAlias, str) and not isinstance(modelAlias, unicode):
        modelAlias = str(modelAlias)

    requestString.append("&modelAlias=%s"%(modelAlias))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjCarIndexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjCarIndexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'brand', u'carSeries', u'modelAlias', u'guidePrice', u'carZwr', u'comAccIndex', u'maintainIndex']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'brand': 'str','carSeries': 'str','modelAlias': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SocialThemeGbBythemeIDGet(themeID, field = "", pandas = "1"):
    """
    获取单个主题(系列1)的社交数据，输入主题ID，获取该主题多个交易日的社交数据。
    
    :param themeID: 主题代码
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialThemeGbBythemeID.csv?ispandas=1&') 
    if not isinstance(themeID, str) and not isinstance(themeID, unicode):
        themeID = str(themeID)

    requestString.append("themeID=%s"%(themeID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SocialThemeGbBythemeIDGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SocialThemeGbBythemeIDGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'tradeDate', u'postNum', u'postPercent']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjWeatherChinaGet(beginDate, province = "", city = "", county = "", endDate = "", field = "", pandas = "1"):
    """
    记录中国各地区天气和空气质量情况，包含最高气温、最低气温、天气、风向、风力、空气质量指数、空气质量状况等。
    
    :param beginDate: 开始日期
    :param province: 省,province、city、county至少选择一个
    :param city: 市,province、city、county至少选择一个
    :param county: 区县,province、city、county至少选择一个
    :param endDate: 截止日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjWeatherChina.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(province, str) and not isinstance(province, unicode):
        province = str(province)

    requestString.append("&province=%s"%(province))
    if not isinstance(city, str) and not isinstance(city, unicode):
        city = str(city)

    requestString.append("&city=%s"%(city))
    if not isinstance(county, str) and not isinstance(county, unicode):
        county = str(county)

    requestString.append("&county=%s"%(county))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjWeatherChinaGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjWeatherChinaGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'province', u'city', u'county', u'periodDate', u'highTemp', u'lowTemp', u'weatherCondition', u'windDirection', u'windScale', u'aqi', u'airQualityCondition']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'province': 'str','city': 'str','county': 'str','weatherCondition': 'str','windDirection': 'str','windScale': 'str','airQualityCondition': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsBodyWechatGet(newsID, field = "", pandas = "1"):
    """
    输入微信新闻的news_id，获取其获取微信新闻全文、新闻链接等
    
    :param newsID: 新闻ID,可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsBodyWechat.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsBodyWechatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsBodyWechatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsBody', u'newsURL', u'effectiveTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsBody': 'str','newsURL': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsContentNewGet(newsID, field = "", pandas = "1"):
    """
    记录新闻的基本信息，包括新闻原始出处、新闻作者、新闻网址、新闻有效发布时间、入库时间、更新时间等。
    
    :param newsID: 新闻ID，可多值输入。新闻ID可通过接口getNewsInfoByInsertTime获取。,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsContentNew.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsContentNewGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsContentNewGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsTitle', u'newsURL', u'newsSource', u'newsAuthor', u'effectiveTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsURL': 'str','newsSource': 'str','newsAuthor': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjAirQualityDayGet(beginDate, city = "", monitorItem = "", endDate = "", field = "", pandas = "1"):
    """
    分城市的空气质量指标，如AQI、PM2.5、PM10、CO、NO2、O3、SO2、温度、湿度、风级、等级、天气等。
    
    :param beginDate: 开始日期
    :param city: 城市,city、monitorItem至少选择一个
    :param monitorItem: 监测项目,city、monitorItem至少选择一个
    :param endDate: 截止日期,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjAirQualityDay.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    if not isinstance(city, str) and not isinstance(city, unicode):
        city = str(city)

    requestString.append("&city=%s"%(city))
    if not isinstance(monitorItem, str) and not isinstance(monitorItem, unicode):
        monitorItem = str(monitorItem)

    requestString.append("&monitorItem=%s"%(monitorItem))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjAirQualityDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjAirQualityDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'city', u'periodDate', u'monitorItem', u'monitorResult', u'unit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'city': 'str','monitorItem': 'str','monitorResult': 'str','unit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjAnalystXcfGet(beginDate, endDate = "", industry = "", partyName = "", analystName = "", prize = "", field = "", pandas = "1"):
    """
    记录新财富网新财富最佳分析师、新财富最佳海外市场研究机构、新财富新三板研究机构、新财富海外销售服务团队、新财富最具影响力机构、新财富最佳销售服务团队、新财富本土最佳研究团队、新财富进步最快研究机构、新财富最具潜力研究机构、新财富最受公募欢迎分析师、新财富最受保险欢迎分析师、新财富最受私募欢迎分析师、新财富最具潜力分析师排名情况。
    
    :param beginDate: 起始日期
    :param endDate: 截止日期,可空
    :param industry: 领域,可空
    :param partyName: 机构名称,可空
    :param analystName: 分析师,可空
    :param prize: 奖项,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjAnalystXcf.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(industry, str) and not isinstance(industry, unicode):
        industry = str(industry)

    requestString.append("&industry=%s"%(industry))
    if not isinstance(partyName, str) and not isinstance(partyName, unicode):
        partyName = str(partyName)

    requestString.append("&partyName=%s"%(partyName))
    if not isinstance(analystName, str) and not isinstance(analystName, unicode):
        analystName = str(analystName)

    requestString.append("&analystName=%s"%(analystName))
    if not isinstance(prize, str) and not isinstance(prize, unicode):
        prize = str(prize)

    requestString.append("&prize=%s"%(prize))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjAnalystXcfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjAnalystXcfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'industry', u'rank', u'partyName', u'partyID', u'analystName', u'prize']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'industry': 'str','partyName': 'str','analystName': 'str','prize': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjGdzjRecordGet(beginDate, endDate = "", type = "", aplInst = "", filingPlace = "", name = "", writer = "", theme = "", field = "", pandas = "1"):
    """
    描述广电总局电视剧、电影、动画片等备案公示和变更备案通报等信息，包含立项日期、申报机构、备案结果、备案地、备案立项号、片名、编剧、题材、集数、总片长、许可证号、拍摄日期、制作周期以及变更后的相关信息。
    
    :param beginDate: 立项起始日期
    :param endDate: 立项截止日期,可空
    :param type: 类型,可空
    :param aplInst: 申报机构,可空
    :param filingPlace: 备案地,可空
    :param name: 片名,可空
    :param writer: 编剧,可空
    :param theme: 题材,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjGdzjRecord.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(type, str) and not isinstance(type, unicode):
        type = str(type)

    requestString.append("&type=%s"%(type))
    if not isinstance(aplInst, str) and not isinstance(aplInst, unicode):
        aplInst = str(aplInst)

    requestString.append("&aplInst=%s"%(aplInst))
    if not isinstance(filingPlace, str) and not isinstance(filingPlace, unicode):
        filingPlace = str(filingPlace)

    requestString.append("&filingPlace=%s"%(filingPlace))
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    if not isinstance(writer, str) and not isinstance(writer, unicode):
        writer = str(writer)

    requestString.append("&writer=%s"%(writer))
    if not isinstance(theme, str) and not isinstance(theme, unicode):
        theme = str(theme)

    requestString.append("&theme=%s"%(theme))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjGdzjRecordGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjGdzjRecordGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'type', u'filingDate', u'aplInst', u'filingResult', u'filingPlace', u'filingNO', u'name', u'writer', u'themeT', u'episodeNum', u'totalMins', u'licenseKey', u'shootDate', u'prodDuration', u'nameChged', u'ttl_timeChged', u'episodesChged', u'producerChged', u'detailChged', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'type': 'str','aplInst': 'str','filingResult': 'str','filingPlace': 'str','filingNO': 'str','name': 'str','writer': 'str','themeT': 'str','licenseKey': 'str','prodDuration': 'str','nameChged': 'str','producerChged': 'str','detailChged': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjInternetGet(beginDate, endDate = "", type = "", platform = "", brand = "", field = "", pandas = "1"):
    """
    记录各浏览器各平台的市场份额数据，包含类别、平台、地区、品牌、市场份额、单位等信息。
    
    :param beginDate: 起始日期
    :param endDate: 截止日期,可空
    :param type: 类别，如"Browsers"、"Search Engines"、"Operating Systems",可空
    :param platform: 平台，如"Desktop"、"Tablet"、"Mobile",可空
    :param brand: 品牌，如"QQ"、"Windows"、"Safari",可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjInternet.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(type, str) and not isinstance(type, unicode):
        type = str(type)

    requestString.append("&type=%s"%(type))
    if not isinstance(platform, str) and not isinstance(platform, unicode):
        platform = str(platform)

    requestString.append("&platform=%s"%(platform))
    if not isinstance(brand, str) and not isinstance(brand, unicode):
        brand = str(brand)

    requestString.append("&brand=%s"%(brand))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjInternetGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjInternetGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'type', u'platform', u'region', u'brand', u'marketShare', u'unit', u'notes', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'type': 'str','platform': 'str','region': 'str','brand': 'str','unit': 'str','notes': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsHeatIndexNewGet(beginDate = "", endDate = "", secID = "", exchangeCD = "", ticker = "", secShortName = "", field = "", pandas = "1"):
    """
    包含机构相关的新闻热度指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻热度指数(即证券当天关联新闻数量占当天新闻总量的百分比(%))。每天更新。（注：1、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；2、数据按日更新。)
    
    :param beginDate: 查询开始日期，默认为一个月前，输入格式“YYYYMMDD”,beginDate、endDate、secID、exchangeCD、ticker、secShortName至少选择一个
    :param endDate: 查询结束日期，默认为当天，输入格式“YYYYMMDD”,beginDate、endDate、secID、exchangeCD、ticker、secShortName至少选择一个
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到，可多值输入，如："000001.XSHE"、"000001.XSHE,600001.XSHG",可以是列表,beginDate、endDate、secID、exchangeCD、ticker、secShortName至少选择一个
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,beginDate、endDate、secID、exchangeCD、ticker、secShortName至少选择一个
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,beginDate、endDate、secID、exchangeCD、ticker、secShortName至少选择一个
    :param secShortName: 证券简称，支持模糊查询,beginDate、endDate、secID、exchangeCD、ticker、secShortName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsHeatIndexNew.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsHeatIndexNewGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsHeatIndexNewGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsEffectiveDate', u'heatIndex', u'newsCount']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsHeatInTimeGet(secID = "", exchangeCD = "", ticker = "", secShortName = "", field = "", pandas = "1"):
    """
    包含机构相关的新闻热度指数数据，输入一个或多个证券交易代码，获取该证券当前时间下的新闻热度指数(即证券当前关联新闻数量占当前新闻总量的百分比(%))。每天更新。（1、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；2、数据不定时更新。)
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到，可多值输入，如："000001.XSHE"、"000001.XSHE,600001.XSHG",可以是列表,secID、exchangeCD、ticker、secShortName至少选择一个
    :param exchangeCD: 证券交易所代码(通联自编)。可选：XSHG、XSHE、XHKG。XSHG表示上海证券交易所，XSHE表示深圳证券交易所，XHKG表示香港交易所。可多值输入,可以是列表,secID、exchangeCD、ticker、secShortName至少选择一个
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,secID、exchangeCD、ticker、secShortName至少选择一个
    :param secShortName: 证券简称，支持模糊查询,secID、exchangeCD、ticker、secShortName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsHeatInTime.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsHeatInTimeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsHeatInTimeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsEffectiveDate', u'heatIndex', u'newsCount']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsSentiIndexGet(ticker = "", secShortName = "", beginDate = "", endDate = "", secID = "", exchangeCD = "", field = "", pandas = "1"):
    """
    包含机构相关的新闻情感指数数据，输入一个或多个证券交易代码、起止日期，获取该证券一段时间内的新闻情感指数(即当天证券关联新闻的情感均值)。（注：1、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；2、数据按日更新。)
    
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,ticker、secShortName、beginDate、endDate、secID、exchangeCD至少选择一个
    :param secShortName: 证券简称，支持模糊查询,ticker、secShortName、beginDate、endDate、secID、exchangeCD至少选择一个
    :param beginDate: 查询开始日期，默认为前30天，输入格式“YYYYMMDD”,ticker、secShortName、beginDate、endDate、secID、exchangeCD至少选择一个
    :param endDate: 查询结束日期，默认为前1天，输入格式“YYYYMMDD”,ticker、secShortName、beginDate、endDate、secID、exchangeCD至少选择一个
    :param secID: 证券内部编码(通联自编),可以是列表,ticker、secShortName、beginDate、endDate、secID、exchangeCD至少选择一个
    :param exchangeCD: 证券交易所代码(通联自编),可以是列表,ticker、secShortName、beginDate、endDate、secID、exchangeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsSentiIndex.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsSentiIndexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsSentiIndexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsEffectiveDate', u'sentimentIndex', u'newsCount']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsSentiIndexInTimeGet(ticker = "", secShortName = "", exchangeCD = "", secID = "", field = "", pandas = "1"):
    """
    包含机构相关的新闻情感指数数据，输入一个或多个证券交易代码、起止日期，获取该证券当前时间下的新闻情感指数(即当天证券关联新闻的情感均值)。（注：1、新闻量的统计口径为经算法处理后证券关联到的所有常规新闻；2、数据不定时更新)
    
    :param ticker: 证券交易代码，可多值输入，如："000001"、"000001,600001",可以是列表,ticker、secShortName、exchangeCD、secID至少选择一个
    :param secShortName: 证券简称，支持模糊查询,ticker、secShortName、exchangeCD、secID至少选择一个
    :param exchangeCD: 证券交易所代码(通联自编),可以是列表,ticker、secShortName、exchangeCD、secID至少选择一个
    :param secID: 证券内部编码(通联自编),可以是列表,ticker、secShortName、exchangeCD、secID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsSentiIndexInTime.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secShortName, str) and not isinstance(secShortName, unicode):
        secShortName = str(secShortName)

    requestString.append("&secShortName=%s"%(secShortName))
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsSentiIndexInTimeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsSentiIndexInTimeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'exchangeCD', u'exchangeName', u'ticker', u'secShortName', u'newsPublishDate', u'sentimentIndex', u'newsCOUNT']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','exchangeCD': 'str','exchangeName': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SocialDataGbByDateGet(statisticsDate, field = "", pandas = "1"):
    """
    包含按单个统计日期获取的系列1的社交数据，输入一个证券交易代码，获取该证券每天的系列1中帖子数量、及帖子占比(%)。
    
    :param statisticsDate: 统计日期，输入格式“YYYYMMDD”
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialDataGbByDate.csv?ispandas=1&') 
    try:
        statisticsDate = statisticsDate.strftime('%Y%m%d')
    except:
        statisticsDate = statisticsDate.replace('-', '')
    requestString.append("statisticsDate=%s"%(statisticsDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SocialDataGbByDateGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SocialDataGbByDateGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'statisticsDate', u'postNum', u'postPercent', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SocialDataGbByTickerGet(ticker, field = "", pandas = "1"):
    """
    包含按单只证券代码获取的系列1的社交数据，输入一个证券交易代码，获取该证券每天的系列1中帖子数量、及帖子占比(%)。
    
    :param ticker: 证券交易代码，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSocialDataGbByTicker.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SocialDataGbByTickerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SocialDataGbByTickerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'statisticsDate', u'postNum', u'postPercent', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsStockTagGet(newsID = "", field = "", pandas = "1"):
    """
    获取公司类新闻标签，包括是否是传闻、是否是公共类新闻、新闻发布时间。
    
    :param newsID: 新闻ID，可多值输入,新闻基本信息可从DataAPI.NewsInfoByTimeGet中获得,可以是列表,newsID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsStockTag.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsStockTagGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsStockTagGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'isAnno', u'isRomour', u'newsPublishTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsEventClassifGet(newsID = "", field = "", pandas = "1"):
    """
    获取新闻事件分类，对公司类新闻进行类别划分。包括新闻ID、事件类型、新闻发布时间。
    
    :param newsID: 新闻ID，可多值输入,新闻基本信息可从DataAPI.NewsInfoByTimeGet中获得,可以是列表,newsID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsEventClassif.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsEventClassifGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsEventClassifGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'eventClassif', u'newsPublishTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'eventClassif': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsInfoWechatGet(newsID, field = "", pandas = "1"):
    """
    输入微信新闻的newsID，获取其基本信息，包括新闻原始出处、新闻作者、新闻网址、新闻有效发布时间、入库时间、更新时间等。
    
    :param newsID: 新闻ID,可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsInfoWechat.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsInfoWechatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsInfoWechatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'effectiveTime', u'newsTitle', u'newsURL', u'newsPublishSite', u'newsSiteType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsTitle': 'str','newsURL': 'str','newsPublishSite': 'str','newsSiteType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def AkOpinionGet(opinionID = "", researchOrg = "", analyst = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    从新闻和研报(后只用新闻)中抽取一些大V观点，以及相关的影响类和策略类的观点，一组相关的观点生成一个条目。
    
    :param opinionID: 观点id,可以是列表,opinionID、researchOrg、analyst至少选择一个
    :param researchOrg: 研究机构，支持模糊查询,opinionID、researchOrg、analyst至少选择一个
    :param analyst: 分析师,可以是列表,opinionID、researchOrg、analyst至少选择一个
    :param beginDate: 起始发布日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止发布日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAkOpinion.csv?ispandas=1&') 
    requestString.append("opinionID=")
    if hasattr(opinionID,'__iter__') and not isinstance(opinionID, str):
        if len(opinionID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = opinionID
            requestString.append(None)
        else:
            requestString.append(','.join(opinionID))
    else:
        requestString.append(opinionID)
    if not isinstance(researchOrg, str) and not isinstance(researchOrg, unicode):
        researchOrg = str(researchOrg)

    requestString.append("&researchOrg=%s"%(researchOrg))
    requestString.append("&analyst=")
    if hasattr(analyst,'__iter__') and not isinstance(analyst, str):
        if len(analyst) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = analyst
            requestString.append(None)
        else:
            requestString.append(','.join(analyst))
    else:
        requestString.append(analyst)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'AkOpinionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'AkOpinionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'opinionID', u'opinionAbstr', u'opinion', u'opinionPara', u'operateRcmd', u'operateRcmdPara', u'eventImpact', u'eventImpactPara', u'researchOrg', u'analyst', u'materialID', u'materialType', u'materialUrl', u'materialTitle', u'publishTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'opinionAbstr': 'str','opinion': 'str','opinionPara': 'str','operateRcmd': 'str','operateRcmdPara': 'str','eventImpact': 'str','eventImpactPara': 'str','researchOrg': 'str','analyst': 'str','materialUrl': 'str','materialTitle': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def AkEventGet(eventID = "", eventType = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    根据新闻聚类的结果和新闻热门程度判别是否构成事件，对每个事件生成一个事件名称、事件描述和一组关键词；事件包括国内外宏观事件、行业事件、公司重大事件等。
    
    :param eventID: 事件ID,可以是列表,eventID、eventType至少选择一个
    :param eventType: 事件类型，0-保留, 1-宏观类，2-公司类，3-其他,可以是列表,eventID、eventType至少选择一个
    :param beginDate: 事件起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 事件截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAkEvent.csv?ispandas=1&') 
    requestString.append("eventID=")
    if hasattr(eventID,'__iter__') and not isinstance(eventID, str):
        if len(eventID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventID
            requestString.append(None)
        else:
            requestString.append(','.join(eventID))
    else:
        requestString.append(eventID)
    requestString.append("&eventType=")
    if hasattr(eventType,'__iter__') and not isinstance(eventType, str):
        if len(eventType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventType
            requestString.append(None)
        else:
            requestString.append(','.join(eventType))
    else:
        requestString.append(eventType)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'AkEventGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'AkEventGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'eventID', u'name', u'abstract', u'size', u'keywords', u'eventKeywords', u'eventType', u'effectTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','abstract': 'str','keywords': 'str','eventKeywords': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def AkEventMatRelGet(eventID, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录新闻事件的关联素材信息，一个事件可能对应多个素材。
    
    :param eventID: 事件ID,可以是列表
    :param beginDate: 素材起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 素材截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getAkEventMatRel.csv?ispandas=1&') 
    requestString.append("eventID=")
    if hasattr(eventID,'__iter__') and not isinstance(eventID, str):
        if len(eventID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = eventID
            requestString.append(None)
        else:
            requestString.append(','.join(eventID))
    else:
        requestString.append(eventID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'AkEventMatRelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'AkEventMatRelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'eventID', u'materialID', u'materialType', u'materialTitle', u'materialUrl', u'materialType', u'eventType', u'matEffectTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'materialTitle': 'str','materialUrl': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjSupercomputerGet(beginDate, endDate = "", country = "", name = "", institution = "", field = "", pandas = "1"):
    """
    记录超级计算机榜单排名数据，包含排名、落户位置、国家代码、名称、开发机构、核心数、持续速度、峰值速度、功率等信息。
    
    :param beginDate: 数据起始日期
    :param endDate: 数据截止日期,可空
    :param country: 国家,可空
    :param name: 名称,可空
    :param institution: 开发机构,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjSupercomputer.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(country, str) and not isinstance(country, unicode):
        country = str(country)

    requestString.append("&country=%s"%(country))
    if not isinstance(name, str) and not isinstance(name, unicode):
        name = str(name)

    requestString.append("&name=%s"%(name))
    if not isinstance(institution, str) and not isinstance(institution, unicode):
        institution = str(institution)

    requestString.append("&institution=%s"%(institution))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjSupercomputerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjSupercomputerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'periodDate', u'rank', u'site', u'country', u'name', u'institution', u'cores', u'rmax', u'rpeak', u'power', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'site': 'str','country': 'str','name': 'str','institution': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjTvPlanGet(beginDate, endDate = "", dramaName = "", typeName = "", area = "", mainPerformer = "", director = "", field = "", pandas = "1"):
    """
    描述电视剧排片计划及电视剧的具体信息，包含电视剧名称、播出时间、类型、地区、主演、导演、语言、集数。
    
    :param beginDate: 播出起始日期
    :param endDate: 播出截止日期,可空
    :param dramaName: 电视剧名称,可空
    :param typeName: 类型,可空
    :param area: 地区,可空
    :param mainPerformer: 主演,可空
    :param director: 导演,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjTvPlan.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(dramaName, str) and not isinstance(dramaName, unicode):
        dramaName = str(dramaName)

    requestString.append("&dramaName=%s"%(dramaName))
    if not isinstance(typeName, str) and not isinstance(typeName, unicode):
        typeName = str(typeName)

    requestString.append("&typeName=%s"%(typeName))
    if not isinstance(area, str) and not isinstance(area, unicode):
        area = str(area)

    requestString.append("&area=%s"%(area))
    if not isinstance(mainPerformer, str) and not isinstance(mainPerformer, unicode):
        mainPerformer = str(mainPerformer)

    requestString.append("&mainPerformer=%s"%(mainPerformer))
    if not isinstance(director, str) and not isinstance(director, unicode):
        director = str(director)

    requestString.append("&director=%s"%(director))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjTvPlanGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjTvPlanGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dramaName', u'releaseTime', u'typeName', u'area', u'mainPerformer', u'director', u'languageType', u'totalEpi', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dramaName': 'str','typeName': 'str','area': 'str','mainPerformer': 'str','director': 'str','languageType': 'str','totalEpi': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SbjFilmShowingsGet(beginDate, endDate = "", city = "", cinemaComp = "", movieCenter = "", film = "", field = "", pandas = "1"):
    """
    描述各电影院网站等平台记录的各地区各影城正在热映电影的排片情况，包含放映日期、排片时段、影院、影城、影片名称、排片场次、排片率。
    
    :param beginDate: 放映起始日期
    :param endDate: 放映截止日期,可空
    :param city: 城市,可空
    :param cinemaComp: 影院,可空
    :param movieCenter: 影城,可空
    :param film: 影片,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getSbjFilmShowings.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(city, str) and not isinstance(city, unicode):
        city = str(city)

    requestString.append("&city=%s"%(city))
    if not isinstance(cinemaComp, str) and not isinstance(cinemaComp, unicode):
        cinemaComp = str(cinemaComp)

    requestString.append("&cinemaComp=%s"%(cinemaComp))
    if not isinstance(movieCenter, str) and not isinstance(movieCenter, unicode):
        movieCenter = str(movieCenter)

    requestString.append("&movieCenter=%s"%(movieCenter))
    if not isinstance(film, str) and not isinstance(film, unicode):
        film = str(film)

    requestString.append("&film=%s"%(film))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SbjFilmShowingsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SbjFilmShowingsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'city', u'periodDate', u'sliceTime', u'cinemaComp', u'movieCenter', u'film', u'showings', u'showingsRatio', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'city': 'str','sliceTime': 'str','cinemaComp': 'str','movieCenter': 'str','film': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NewsKeywordsGet(newsID, field = "", pandas = "1"):
    """
    获取新闻的关键词和NER标签，包括新闻关键词、新闻公司名实体标签和新闻产品名实体标签等信息。
    
    :param newsID: 新闻ID，可多值输入,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/subject/getNewsKeywords.csv?ispandas=1&') 
    requestString.append("newsID=")
    if hasattr(newsID,'__iter__') and not isinstance(newsID, str):
        if len(newsID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = newsID
            requestString.append(None)
        else:
            requestString.append(','.join(newsID))
    else:
        requestString.append(newsID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NewsKeywordsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NewsKeywordsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'newsID', u'newsKeywords', u'newsKeyphrase', u'newsPerson', u'newsProduct', u'newsCompany', u'updateTime', u'newsFund']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'newsKeywords': 'str','newsKeyphrase': 'str','newsPerson': 'str','newsProduct': 'str','newsCompany': 'str','newsFund': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqSharesDivGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    1.分红释义：是将当年的收益，在按规定提取法定公积金、公益金等项目后向股东发放，是股东收益的一种方式，通常股东得到分红后会继续投资该企业达到复利的作用；2.表描述：记录新三板挂牌公司分红进展及派息、送股、转增的情况。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始报告期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止报告期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqSharesDiv.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqSharesDivGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqSharesDivGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'reportPeriod', u'bonusShareListDate', u'cashDivDate', u'dividendTgt', u'eventChg', u'exDivDate', u'isChg', u'perShareDivAft', u'perShareDivPre', u'perShareDivRatio', u'perShareTransRatio', u'planPublishDate', u'publishDate', u'recodChg', u'recordDate', u'schDesc', u'secID', u'secShortName', u'sharesBasic', u'sharesBasicDate', u'shcPublishDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','dividendTgt': 'str','recodChg': 'str','schDesc': 'str','secID': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqHoldersNumGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    1.记录新三板挂牌公司股东户数变化信息；2.数据范围：报告期、日常。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 机构内部ID,可以是列表,secID、ticker、partyID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqHoldersNum.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqHoldersNumGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqHoldersNumGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'endDate', u'shNum', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqTransIntentionGet(secID = "", ticker = "", beginDate = "", endDate = "", side = "", isBargaining = "", isActive = "", field = "", pandas = "1"):
    """
    1.转让意向平台释义：适用于全国股转系统所有挂牌证券品种，为注册用户提供转让意向信息的发布和查询服务。同时，该平台不具有成交功能，买卖双方达成成交协议后，仍需通过全国股转系统交易主机完成交易；2.用户范围：新三板合格投资者； 3.发布信息范围：证券代码、买卖方向、买卖价格、买卖数量、联系人、联系方式、有效期等。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 根据意向发布日期查询的起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 根据意向发布日期查询的截止日期,输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param side: 买卖方向，输入“买入”或“卖出”,可空
    :param isBargaining: 可否议价。1-是，0-否，9-未获知,可以是列表,可空
    :param isActive: 是否有效。1-是，0-否，9-未获知,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqTransIntention.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(side, str) and not isinstance(side, unicode):
        side = str(side)

    requestString.append("&side=%s"%(side))
    requestString.append("&isBargaining=")
    if hasattr(isBargaining,'__iter__') and not isinstance(isBargaining, str):
        if len(isBargaining) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isBargaining
            requestString.append(None)
        else:
            requestString.append(','.join(isBargaining))
    else:
        requestString.append(isBargaining)
    requestString.append("&isActive=")
    if hasattr(isActive,'__iter__') and not isinstance(isActive, str):
        if len(isActive) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isActive
            requestString.append(None)
        else:
            requestString.append(','.join(isActive))
    else:
        requestString.append(isActive)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqTransIntentionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqTransIntentionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'publishDate', u'side', u'intentionPrice', u'closePrice', u'transShares', u'isBargaining', u'endDate', u'contacts', u'contactInfo', u'accountNumber', u'isActive', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','side': 'str','isBargaining': 'str','contacts': 'str','contactInfo': 'str','accountNumber': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqCompLevelGet(secID = "", partyID = "", ticker = "", level = "", field = "", pandas = "1"):
    """
    当前新三板基础层和创新层公司信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、partyID、ticker至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、partyID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、partyID、ticker至少选择一个
    :param level: 新三板挂牌公司按照全国股转系统制定的层级标准划分“基础层”和“创新层”两类。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqCompLevel.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&level=")
    if hasattr(level,'__iter__') and not isinstance(level, str):
        if len(level) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = level
            requestString.append(None)
        else:
            requestString.append(','.join(level))
    else:
        requestString.append(level)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqCompLevelGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqCompLevelGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'exchangeCD', u'level', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCD': 'str','level': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqMktMakerGet(partyID = "", partyFullName = "", mktMaker = "", field = "", pandas = "1"):
    """
    记录做市商做市机构数量、股票数量、参与做市情况、做市商规模等基本信息。
    
    :param partyID: 通联编制的机构编码，在本表中也称作“做市商ID”，可在DataAPI.PartyIDGet接口获取。,可以是列表,partyID、partyFullName、mktMaker至少选择一个
    :param partyFullName: 做市商机构全称，如“兴业证券股份有限公司”，可在DataAPI.PartyIDGet接口与PARTY_ID对应获取信息。,可以是列表,partyID、partyFullName、mktMaker至少选择一个
    :param mktMaker: 做市商机构简称，如“兴业证券”，与机构全称相对应。,可以是列表,partyID、partyFullName、mktMaker至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqMktMaker.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&partyFullName=")
    if hasattr(partyFullName,'__iter__') and not isinstance(partyFullName, str):
        if len(partyFullName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyFullName
            requestString.append(None)
        else:
            requestString.append(','.join(partyFullName))
    else:
        requestString.append(partyFullName)
    requestString.append("&mktMaker=")
    if hasattr(mktMaker,'__iter__') and not isinstance(mktMaker, str):
        if len(mktMaker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = mktMaker
            requestString.append(None)
        else:
            requestString.append(','.join(mktMaker))
    else:
        requestString.append(mktMaker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqMktMakerGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqMktMakerGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'partyFullName', u'mktMaker', u'mktSharesVol', u'mktShares', u'mktSharesPct', u'mktMakerFir', u'mktSharesVolFir', u'mktDate', u'totalShares', u'marketValue', u'floatShares', u'negMarketValue', u'neeqShares', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyFullName': 'str','mktMaker': 'str','mktShares': 'str','mktSharesVolFir': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktNeeqStatsGet(beginDate = "", endDate = "", statsFreq = "", statsItemCD = "", field = "", pandas = "1"):
    """
    获取新三板每日市场概况信息，包含挂牌公司家数、当日新增家数、总股本、流通股本、成交股票只数、成交金额、成交数量等。以指标形式记录。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param statsFreq: 统计周期代码，D-日；W-周；M-月,可以是列表,可空
    :param statsItemCD: 统计项目代码，可使用DataAPI.SysCodeGet.codeTypeID=12007获取,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getMktNeeqStats.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&statsFreq=")
    if hasattr(statsFreq,'__iter__') and not isinstance(statsFreq, str):
        if len(statsFreq) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsFreq
            requestString.append(None)
        else:
            requestString.append(','.join(statsFreq))
    else:
        requestString.append(statsFreq)
    requestString.append("&statsItemCD=")
    if hasattr(statsItemCD,'__iter__') and not isinstance(statsItemCD, str):
        if len(statsItemCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsItemCD
            requestString.append(None)
        else:
            requestString.append(','.join(statsItemCD))
    else:
        requestString.append(statsItemCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktNeeqStatsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktNeeqStatsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'endDate', u'statsFreq', u'statsItemCD', u'transType', u'statsValue', u'unit', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'statsFreq': 'str','transType': 'str','unit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktNeeqIssueStatsGet(beginDate = "", endDate = "", statsFreq = "", field = "", pandas = "1"):
    """
    获取新三板发行统计，包含周度发行次数、发行股数、发行均价、募集资金；月度拟发行次数、拟发行股数、拟发行均价、拟募集资金。
    
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param statsFreq: 统计周期代码，W-周；M-月,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getMktNeeqIssueStats.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&statsFreq=")
    if hasattr(statsFreq,'__iter__') and not isinstance(statsFreq, str):
        if len(statsFreq) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsFreq
            requestString.append(None)
        else:
            requestString.append(','.join(statsFreq))
    else:
        requestString.append(statsFreq)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktNeeqIssueStatsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktNeeqIssueStatsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'endDate', u'statsFreq', u'issueNum', u'issueShares', u'issueCap', u'issueAvgPrice', u'issueNumIntend', u'issueSharesIntend', u'issueCapIntend', u'issueAvgPriceIntend', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'statsFreq': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktNeeqTurnoverTenGet(statsType = "", statsFreq = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取新三板周度及月度成交前十的股票信息，包含成交量、成交金额、换手率、成交均价等。
    
    :param statsType: 统计类型代码，可使用DataAPI.SysCodeGet.codeTypeID=12009获取,可以是列表,statsType、statsFreq、ticker至少选择一个
    :param statsFreq: 统计周期代码，W-周；M-月,可以是列表,statsType、statsFreq、ticker至少选择一个
    :param ticker: 通用交易代码,可以是列表,statsType、statsFreq、ticker至少选择一个
    :param beginDate: 查询起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getMktNeeqTurnoverTen.csv?ispandas=1&') 
    requestString.append("statsType=")
    if hasattr(statsType,'__iter__') and not isinstance(statsType, str):
        if len(statsType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsType
            requestString.append(None)
        else:
            requestString.append(','.join(statsType))
    else:
        requestString.append(statsType)
    requestString.append("&statsFreq=")
    if hasattr(statsFreq,'__iter__') and not isinstance(statsFreq, str):
        if len(statsFreq) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = statsFreq
            requestString.append(None)
        else:
            requestString.append(','.join(statsFreq))
    else:
        requestString.append(statsFreq)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktNeeqTurnoverTenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktNeeqTurnoverTenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'statsType', u'statsFreq', u'endDate', u'rank', u'ticker', u'secShortName', u'transType', u'avgPrice', u'turnoverVol', u'turnoverValue', u'turnoverRate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'statsFreq': 'str','ticker': 'str','secShortName': 'str','transType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqBusiAnalyHisGet(secID = "", ticker = "", textType = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录新三板公司报告期及公开转让说明书中公布的经营分析情况及公司简史。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param textType: 文本类别。1-公司简史，2-经营分析,可以是列表,可空
    :param beginDate: 起始报告期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止报告期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqBusiAnalyHis.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&textType=")
    if hasattr(textType,'__iter__') and not isinstance(textType, str):
        if len(textType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = textType
            requestString.append(None)
        else:
            requestString.append(','.join(textType))
    else:
        requestString.append(textType)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqBusiAnalyHisGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqBusiAnalyHisGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'textType', u'endDate', u'textInfo', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','textType': 'str','textInfo': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqSharesTransfGet(securityIDPre = "", tickerSymbolPre = "", exchangeCDPre = "", securityIDAf = "", tickerSymbolAf = "", exchangeCDAf = "", field = "", pandas = "1"):
    """
    记录与新三板及老三板相关的转板情况；包括三板退市转板至其他市场（主板、中小板、创业板）公司、其他市场退市转板至三板市场公司（主板、中小板、创业板转板至老三板；老三板转板至新三板）等。
    
    :param securityIDPre: 转板前的证券编码，通联编制，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,securityIDPre、tickerSymbolPre、exchangeCDPre、securityIDAf、tickerSymbolAf、exchangeCDAf至少选择一个
    :param tickerSymbolPre: 转板前证券在证券市场通用的交易代码。,可以是列表,securityIDPre、tickerSymbolPre、exchangeCDPre、securityIDAf、tickerSymbolAf、exchangeCDAf至少选择一个
    :param exchangeCDPre: 转板前证券所在交易市场。,可以是列表,securityIDPre、tickerSymbolPre、exchangeCDPre、securityIDAf、tickerSymbolAf、exchangeCDAf至少选择一个
    :param securityIDAf: 转板后的证券编码，通联编制，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,securityIDPre、tickerSymbolPre、exchangeCDPre、securityIDAf、tickerSymbolAf、exchangeCDAf至少选择一个
    :param tickerSymbolAf: 转板后证券在证券市场通用的交易代码。,可以是列表,securityIDPre、tickerSymbolPre、exchangeCDPre、securityIDAf、tickerSymbolAf、exchangeCDAf至少选择一个
    :param exchangeCDAf: 转板后证券所在交易市场。,可以是列表,securityIDPre、tickerSymbolPre、exchangeCDPre、securityIDAf、tickerSymbolAf、exchangeCDAf至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqSharesTransf.csv?ispandas=1&') 
    requestString.append("securityIDPre=")
    if hasattr(securityIDPre,'__iter__') and not isinstance(securityIDPre, str):
        if len(securityIDPre) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = securityIDPre
            requestString.append(None)
        else:
            requestString.append(','.join(securityIDPre))
    else:
        requestString.append(securityIDPre)
    requestString.append("&tickerSymbolPre=")
    if hasattr(tickerSymbolPre,'__iter__') and not isinstance(tickerSymbolPre, str):
        if len(tickerSymbolPre) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tickerSymbolPre
            requestString.append(None)
        else:
            requestString.append(','.join(tickerSymbolPre))
    else:
        requestString.append(tickerSymbolPre)
    requestString.append("&exchangeCDPre=")
    if hasattr(exchangeCDPre,'__iter__') and not isinstance(exchangeCDPre, str):
        if len(exchangeCDPre) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCDPre
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCDPre))
    else:
        requestString.append(exchangeCDPre)
    requestString.append("&securityIDAf=")
    if hasattr(securityIDAf,'__iter__') and not isinstance(securityIDAf, str):
        if len(securityIDAf) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = securityIDAf
            requestString.append(None)
        else:
            requestString.append(','.join(securityIDAf))
    else:
        requestString.append(securityIDAf)
    requestString.append("&tickerSymbolAf=")
    if hasattr(tickerSymbolAf,'__iter__') and not isinstance(tickerSymbolAf, str):
        if len(tickerSymbolAf) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tickerSymbolAf
            requestString.append(None)
        else:
            requestString.append(','.join(tickerSymbolAf))
    else:
        requestString.append(tickerSymbolAf)
    requestString.append("&exchangeCDAf=")
    if hasattr(exchangeCDAf,'__iter__') and not isinstance(exchangeCDAf, str):
        if len(exchangeCDAf) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCDAf
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCDAf))
    else:
        requestString.append(exchangeCDAf)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqSharesTransfGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqSharesTransfGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'securityIDPre', u'tickerSymbolPre', u'secShortNamePre', u'exchangeCDPre', u'listDatePre', u'delistDatePre', u'totalSharesPre', u'securityIDAf', u'tickerSymbolAf', u'secShortNameAf', u'exchangeCDAf', u'listDateAf', u'totalSharesAf', u'eventProcess', u'publishDate', u'updateTime', u'note']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'securityIDPre': 'str','tickerSymbolPre': 'str','secShortNamePre': 'str','exchangeCDPre': 'str','securityIDAf': 'str','tickerSymbolAf': 'str','secShortNameAf': 'str','exchangeCDAf': 'str','eventProcess': 'str','note': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqTurnoverChgGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录新三板挂牌公司发生交易异动(股价异常波动大于50%)的交易汇总信息，包含成交均价、成交量合计及成交额合计信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqTurnoverChg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqTurnoverChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqTurnoverChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeDate', u'turnoverPrice', u'turnoverVol', u'turnoverVal', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqTurnoverChgDetlGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录新三板挂牌公司发生交易异动（投资者成交价格较前收盘价变动幅度超过50%的情形）的交易明细信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqTurnoverChgDetl.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqTurnoverChgDetlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqTurnoverChgDetlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeDate', u'turnoverPrice', u'turnoverVol', u'turnoverVal', u'accoutB', u'salesB', u'accoutS', u'salesS', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','accoutB': 'str','salesB': 'str','accoutS': 'str','salesS': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqGamblAgreementGet(secID = "", ticker = "", beginPubDate = "", endPubDate = "", reportDate = "", field = "", pandas = "1"):
    """
    1.记录新三板挂牌公司发生的对赌协议情况；2.对赌协议释义：收购方（包括投资方）与出让方（包括融资方）在达成并购（或者融资）协议时，对于未来不确定的情况进行一种约定。如果约定的条件出现，投资方可以行使一种权利；如果约定的条件不出现，融资方则行使一种权利。对赌协议实际上就是期权的一种形式。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginPubDate、endPubDate、reportDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginPubDate、endPubDate、reportDate至少选择一个
    :param beginPubDate: 最新公告日起始日期，输入格式“YYYYMMDD”,secID、ticker、beginPubDate、endPubDate、reportDate至少选择一个
    :param endPubDate: 最新公告日截止日期，输入格式“YYYYMMDD”,secID、ticker、beginPubDate、endPubDate、reportDate至少选择一个
    :param reportDate: 报告期，输入格式为“YYYY0630、YYYY0930、YYYY1231”,可以是列表,secID、ticker、beginPubDate、endPubDate、reportDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqGamblAgreement.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginPubDate = beginPubDate.strftime('%Y%m%d')
    except:
        beginPubDate = beginPubDate.replace('-', '')
    requestString.append("&beginPubDate=%s"%(beginPubDate))
    try:
        endPubDate = endPubDate.strftime('%Y%m%d')
    except:
        endPubDate = endPubDate.replace('-', '')
    requestString.append("&endPubDate=%s"%(endPubDate))
    requestString.append("&reportDate=")
    if hasattr(reportDate,'__iter__') and not isinstance(reportDate, str):
        if len(reportDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = reportDate
            requestString.append(None)
        else:
            requestString.append(','.join(reportDate))
    else:
        requestString.append(reportDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqGamblAgreementGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqGamblAgreementGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'newPubDate', u'proDate', u'investors', u'subjectParty', u'transfer', u'reportDate', u'comtNetProfit', u'gamMakeWay', u'gamProvis', u'beginDate', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','investors': 'str','subjectParty': 'str','transfer': 'str','gamMakeWay': 'str','gamProvis': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqHaltResumpGet(secID = "", ticker = "", beginDateHaltBegin = "", endDateHaltBegin = "", beginDateHaltEnd = "", endDateHaltEnd = "", haltPlan = "", field = "", pandas = "1"):
    """
    记录新三板挂牌公司停复牌信息，包括停牌日期、复牌日期、停牌类型、停牌原因等。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDateHaltBegin、endDateHaltBegin、beginDateHaltEnd、endDateHaltEnd至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDateHaltBegin、endDateHaltBegin、beginDateHaltEnd、endDateHaltEnd至少选择一个
    :param beginDateHaltBegin: 停牌开始时间的起始查询日期，输入格式“YYMMDD”,secID、ticker、beginDateHaltBegin、endDateHaltBegin、beginDateHaltEnd、endDateHaltEnd至少选择一个
    :param endDateHaltBegin: 停牌开始时间的截止查询日期，输入格式“YYMMDD”且需在想获取的数据日期上+1,secID、ticker、beginDateHaltBegin、endDateHaltBegin、beginDateHaltEnd、endDateHaltEnd至少选择一个
    :param beginDateHaltEnd: 停牌结束时间的起始查询日期，输入格式“YYMMDD”,secID、ticker、beginDateHaltBegin、endDateHaltBegin、beginDateHaltEnd、endDateHaltEnd至少选择一个
    :param endDateHaltEnd: 停牌结束时间的截止查询日期，输入格式“YYMMDD”且需在想获取的数据日期上+1,secID、ticker、beginDateHaltBegin、endDateHaltBegin、beginDateHaltEnd、endDateHaltEnd至少选择一个
    :param haltPlan: 停牌安排。1-停牌一小时，2-停牌一天，3-临时停牌，4-连续停牌，5-盘中停牌，6-下午停牌,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqHaltResump.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDateHaltBegin = beginDateHaltBegin.strftime('%Y%m%d')
    except:
        beginDateHaltBegin = beginDateHaltBegin.replace('-', '')
    requestString.append("&beginDateHaltBegin=%s"%(beginDateHaltBegin))
    try:
        endDateHaltBegin = endDateHaltBegin.strftime('%Y%m%d')
    except:
        endDateHaltBegin = endDateHaltBegin.replace('-', '')
    requestString.append("&endDateHaltBegin=%s"%(endDateHaltBegin))
    try:
        beginDateHaltEnd = beginDateHaltEnd.strftime('%Y%m%d')
    except:
        beginDateHaltEnd = beginDateHaltEnd.replace('-', '')
    requestString.append("&beginDateHaltEnd=%s"%(beginDateHaltEnd))
    try:
        endDateHaltEnd = endDateHaltEnd.strftime('%Y%m%d')
    except:
        endDateHaltEnd = endDateHaltEnd.replace('-', '')
    requestString.append("&endDateHaltEnd=%s"%(endDateHaltEnd))
    requestString.append("&haltPlan=")
    if hasattr(haltPlan,'__iter__') and not isinstance(haltPlan, str):
        if len(haltPlan) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = haltPlan
            requestString.append(None)
        else:
            requestString.append(','.join(haltPlan))
    else:
        requestString.append(haltPlan)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqHaltResumpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqHaltResumpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'haltPlan', u'haltBeginTime', u'haltEndTime', u'resumpBeginTime', u'resumpReason', u'remark', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','haltPlan': 'str','resumpReason': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqReportPrediscloGet(secID = "", ticker = "", endDate = "", field = "", pandas = "1"):
    """
    记录老三板、新三板挂牌公司年报、半年报、季报预披露及实际披露情况。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param endDate: 报告期，输入格式为“YYYY0630、YYYY0930、YYYY1231”,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqReportPredisclo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&endDate=")
    if hasattr(endDate,'__iter__') and not isinstance(endDate, str):
        if len(endDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = endDate
            requestString.append(None)
        else:
            requestString.append(','.join(endDate))
    else:
        requestString.append(endDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqReportPrediscloGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqReportPrediscloGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'endDate', u'preDate', u'actDate', u'updateTimes', u'updateDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqSectionGet(secID = "", ticker = "", partyID = "", beginDateIn = "", endDateIn = "", sectionType = "", levelTypeCD = "", field = "", pandas = "1"):
    """
    记录新三板挂牌公司不同标准下所属的行业分类，包括证监会、管理型、投资型三大标准对应的挂牌公司行业分类信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID、beginDateIn、endDateIn至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID、beginDateIn、endDateIn至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID、beginDateIn、endDateIn至少选择一个
    :param beginDateIn: 进入分类的起始查询日期，输入格式“YYYYMMDD”,secID、ticker、partyID、beginDateIn、endDateIn至少选择一个
    :param endDateIn: 进入分类的截止查询日期，输入格式“YYYYMMDD”,secID、ticker、partyID、beginDateIn、endDateIn至少选择一个
    :param sectionType: 行业分类。010301-证监会行业，010303-申万行业分类2014版，010309-三板投资型分类，010310-三板管理型分类,可以是列表,可空
    :param levelTypeCD: 所分类别的代码。如：投资2级-1810 电信业务，可在DataAPI.SysCodeGet接口输入codeTypeID=90044获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqSection.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDateIn = beginDateIn.strftime('%Y%m%d')
    except:
        beginDateIn = beginDateIn.replace('-', '')
    requestString.append("&beginDateIn=%s"%(beginDateIn))
    try:
        endDateIn = endDateIn.strftime('%Y%m%d')
    except:
        endDateIn = endDateIn.replace('-', '')
    requestString.append("&endDateIn=%s"%(endDateIn))
    requestString.append("&sectionType=")
    if hasattr(sectionType,'__iter__') and not isinstance(sectionType, str):
        if len(sectionType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = sectionType
            requestString.append(None)
        else:
            requestString.append(','.join(sectionType))
    else:
        requestString.append(sectionType)
    requestString.append("&levelTypeCD=")
    if hasattr(levelTypeCD,'__iter__') and not isinstance(levelTypeCD, str):
        if len(levelTypeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = levelTypeCD
            requestString.append(None)
        else:
            requestString.append(','.join(levelTypeCD))
    else:
        requestString.append(levelTypeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqSectionGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqSectionGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'sectionType', u'level', u'levelTypeNM', u'levelTypeCD', u'beginDate', u'endDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','sectionType': 'str','levelTypeNM': 'str','levelTypeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqMSchangeGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    1.记录新三板公司高管持有公司股份份额信息；2.高管范围：现任董事、监事、高级管理人员。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 查询范围起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 查询范围截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqMSchange.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqMSchangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqMSchangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'secFullName', u'endDate', u'name', u'position', u'holdVol', u'holdChange', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','secFullName': 'str','name': 'str','position': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqSalesGet(beginDate, sales = "", endDate = "", field = "", pandas = "1"):
    """
    统计证券公司营业部在新三板买卖的数量及交易金额概况。
    
    :param beginDate: 起始交易日期，输入格式“YYYYMMDD”
    :param sales: 营业部中文名称，如“安信证券济南泉城路证券营业部”,可以是列表,可空
    :param endDate: 截止交易日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqSales.csv?ispandas=1&') 
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("beginDate=%s"%(beginDate))
    requestString.append("&sales=")
    if hasattr(sales,'__iter__') and not isinstance(sales, str):
        if len(sales) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = sales
            requestString.append(None)
        else:
            requestString.append(','.join(sales))
    else:
        requestString.append(sales)
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqSalesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqSalesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'sales', u'tradeDate', u'buyVal', u'buyVol', u'sellVal', u'sellVol', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'sales': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqSalesDetlGet(secID = "", ticker = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录协议转让方式下新三板挂牌公司的每一笔成交明细信息。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param beginDate: 起始成交日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止成交日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqSalesDetl.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqSalesDetlGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqSalesDetlGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeDate', u'tradeVal', u'tradePrice', u'tradeVol', u'buyBroker', u'sellBroker', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','buyBroker': 'str','sellBroker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqTransfWayGet(secID = "", ticker = "", beginSearchDate = "", endSearchDate = "", transWay = "", isNew = "", field = "", pandas = "1"):
    """
    记录三板公司协议、做市、竞价转让方式及变更情况。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param beginSearchDate: 根据转让方式起始日期查询的开始日期，输入格式“YYYYMMDD”,可空
    :param endSearchDate: 根据转让方式起始日期查询的结束日期，输入格式“YYYYMMDD”,可空
    :param transWay: 转让方式。1-协议，2-做市，3-竞价，4-意向，5-大宗交易,可以是列表,可空
    :param isNew: 是否最新。0-否，1-是，9-未获知,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqTransfWay.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginSearchDate = beginSearchDate.strftime('%Y%m%d')
    except:
        beginSearchDate = beginSearchDate.replace('-', '')
    requestString.append("&beginSearchDate=%s"%(beginSearchDate))
    try:
        endSearchDate = endSearchDate.strftime('%Y%m%d')
    except:
        endSearchDate = endSearchDate.replace('-', '')
    requestString.append("&endSearchDate=%s"%(endSearchDate))
    requestString.append("&transWay=")
    if hasattr(transWay,'__iter__') and not isinstance(transWay, str):
        if len(transWay) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = transWay
            requestString.append(None)
        else:
            requestString.append(','.join(transWay))
    else:
        requestString.append(transWay)
    if not isinstance(isNew, str) and not isinstance(isNew, unicode):
        isNew = str(isNew)

    requestString.append("&isNew=%s"%(isNew))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqTransfWayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqTransfWayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'beginDate', u'endDate', u'transWay', u'isNew', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','transWay': 'str','isNew': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqXYWTtradeGet(secID = "", ticker = "", beginDate = "", endDate = "", tradeType = "", field = "", pandas = "1"):
    """
    记录新三板协议转让报买报卖的每笔明细数据。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 交易日截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 交易日起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param tradeType: 委托类别。1-定价买入，2-定价卖出,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqXYWTtrade.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(tradeType, str) and not isinstance(tradeType, unicode):
        tradeType = str(tradeType)

    requestString.append("&tradeType=%s"%(tradeType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqXYWTtradeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqXYWTtradeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeDate', u'tradePrice', u'tradeVol', u'tradeType', u'perPrice', u'autoNum', u'priceTime', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','tradeType': 'str','perPrice': 'str','autoNum': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqZSWTtradeGet(secID = "", ticker = "", beginDate = "", endDate = "", tradeType = "", field = "", pandas = "1"):
    """
    记录新三板做市转让报买报卖的每笔明细数据。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、beginDate、endDate至少选择一个
    :param beginDate: 交易日截止日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param endDate: 交易日起始日期，输入格式“YYYYMMDD”,secID、ticker、beginDate、endDate至少选择一个
    :param tradeType: 业务类别。1-买一，10-买十，11-卖一 等，可在DataAPI.SysCodeGet接口输入codeTypeID=90020获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqZSWTtrade.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&tradeType=")
    if hasattr(tradeType,'__iter__') and not isinstance(tradeType, str):
        if len(tradeType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeType
            requestString.append(None)
        else:
            requestString.append(','.join(tradeType))
    else:
        requestString.append(tradeType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqZSWTtradeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqZSWTtradeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'tradeDate', u'tradeType', u'tradePrice', u'tradeVol', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','tradeType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqShareNameChg2Get(secID = "", ticker = "", renamedBfChange = "", field = "", pandas = "1"):
    """
    记录新三板挂牌公司公司简称变更情况（更名日期，更名前后简称）。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、renamedBfChange至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、renamedBfChange至少选择一个
    :param renamedBfChange: 旧的证券中文简称，如“华强文化”，可用于搜索与其相关的证券简称变动,可以是列表,secID、ticker、renamedBfChange至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqShareNameChg2.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&renamedBfChange=")
    if hasattr(renamedBfChange,'__iter__') and not isinstance(renamedBfChange, str):
        if len(renamedBfChange) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = renamedBfChange
            requestString.append(None)
        else:
            requestString.append(','.join(renamedBfChange))
    else:
        requestString.append(renamedBfChange)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqShareNameChg2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqShareNameChg2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'changeDate', u'renamedBfChange', u'renamedAfChange', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','renamedBfChange': 'str','renamedAfChange': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqVarGet(secID = "", ticker = "", secFullName = "", varType = "", field = "", pandas = "1"):
    """
    记录新三板挂牌公司组织机构代码和社会信用代码。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、secFullName至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、secFullName至少选择一个
    :param secFullName: 公司全名，支持模糊查询,secID、ticker、secFullName至少选择一个
    :param varType: 业务类型。1-组织机构代码证，2-统一社会信用代码,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqVar.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(secFullName, str) and not isinstance(secFullName, unicode):
        secFullName = str(secFullName)

    requestString.append("&secFullName=%s"%(secFullName))
    if not isinstance(varType, str) and not isinstance(varType, unicode):
        varType = str(varType)

    requestString.append("&varType=%s"%(varType))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqVarGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqVarGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'secFullName', u'varType', u'varSymbol', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','secFullName': 'str','varType': 'str','varSymbol': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqPreListTutoGet(secID = "", ticker = "", beginPubDate = "", endPubDate = "", field = "", pandas = "1"):
    """
    记录新三板拟发行股票并上市的股份公司的辅导进度及基本情况。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker至少选择一个
    :param beginPubDate: 根据公告日期查询的起始日期，输入格式“YYYYMMDD”,可空
    :param endPubDate: 根据公告日期查询的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqPreListTuto.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    try:
        beginPubDate = beginPubDate.strftime('%Y%m%d')
    except:
        beginPubDate = beginPubDate.replace('-', '')
    requestString.append("&beginPubDate=%s"%(beginPubDate))
    try:
        endPubDate = endPubDate.strftime('%Y%m%d')
    except:
        endPubDate = endPubDate.replace('-', '')
    requestString.append("&endPubDate=%s"%(endPubDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqPreListTutoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqPreListTutoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'publishDate', u'partyName', u'beginDate', u'endDate', u'listDate', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','partyName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqCompanyNameChgGet(secID = "", ticker = "", partyID = "", renamedBfCn = "", field = "", pandas = "1"):
    """
    1.记录公司名称变更情况（更名日期，更名前后名称）；2.数据范围：新三板上市至退市期间发生的公司名称变更。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID、renamedBfCn至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID、renamedBfCn至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID、renamedBfCn至少选择一个
    :param renamedBfCn: 更名前公司的中文名称，支持模糊查询,secID、ticker、partyID、renamedBfCn至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqCompanyNameChg.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    if not isinstance(renamedBfCn, str) and not isinstance(renamedBfCn, unicode):
        renamedBfCn = str(renamedBfCn)

    requestString.append("&renamedBfCn=%s"%(renamedBfCn))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqCompanyNameChgGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqCompanyNameChgGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'changeDate', u'renamedBfCn', u'renamedAfCn', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','renamedBfCn': 'str','renamedAfCn': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqlistInfoGet(secID = "", ticker = "", partyID = "", partyName = "", beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    记录全国股份转让系统在审申请挂牌企业基本情况。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID、partyName至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID、partyName至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID、partyName至少选择一个
    :param partyName: 公司名称,支持模糊查询,secID、ticker、partyID、partyName至少选择一个
    :param beginDate: 根据完成申报的截止日期查询的起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 根据完成申报的截止日期查询的截止日期，输入格式“YYYYMMDD”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqlistInfo.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    if not isinstance(partyName, str) and not isinstance(partyName, unicode):
        partyName = str(partyName)

    requestString.append("&partyName=%s"%(partyName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqlistInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqlistInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'partyName', u'province', u'industry', u'sponBroker', u'sponBrokerPers', u'lawFirm', u'lfLawer', u'accountFirm', u'afCertifiedPers', u'isIssue', u'reviewRpog', u'acceptDate', u'firFeedback', u'firReplay', u'secFeedback', u'secReplay', u'thirFeedback', u'thirReplay', u'fortFeedback', u'fortReplay', u'fivFeedback', u'fivReplay', u'sixFeedback', u'sixReplay', u'endDate', u'isNew', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','partyName': 'str','province': 'str','industry': 'str','sponBroker': 'str','sponBrokerPers': 'str','lawFirm': 'str','lfLawer': 'str','accountFirm': 'str','afCertifiedPers': 'str','isIssue': 'str','reviewRpog': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqIntermediariesGet(secID = "", ticker = "", partyID = "", interType = "", busiType = "", isNew = "", field = "", pandas = "1"):
    """
    1.记录挂牌公司涉及的中介机构信息；2.数据范围：首发、增发、做市；3.中介机构范围：主承销商、会计师事务所、律师事务所、资产评估机构、经办人员等。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID至少选择一个
    :param interType: 机构类型。1-主承销商，2-副承销商，3-会计师事务所等，可在DataAPI.SysCodeGet接口输入codeTypeID=90015获取到,可以是列表,可空
    :param busiType: 业务类型。1-首发，2-增发，3-做市,可以是列表,可空
    :param isNew: 是否最新。1-是，2-否，9-未获知,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqIntermediaries.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    requestString.append("&interType=")
    if hasattr(interType,'__iter__') and not isinstance(interType, str):
        if len(interType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = interType
            requestString.append(None)
        else:
            requestString.append(','.join(interType))
    else:
        requestString.append(interType)
    requestString.append("&busiType=")
    if hasattr(busiType,'__iter__') and not isinstance(busiType, str):
        if len(busiType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = busiType
            requestString.append(None)
        else:
            requestString.append(','.join(busiType))
    else:
        requestString.append(busiType)
    requestString.append("&isNew=")
    if hasattr(isNew,'__iter__') and not isinstance(isNew, str):
        if len(isNew) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = isNew
            requestString.append(None)
        else:
            requestString.append(','.join(isNew))
    else:
        requestString.append(isNew)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqIntermediariesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqIntermediariesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'secID', u'ticker', u'secShortName', u'interType', u'interName', u'busiType', u'beginDate', u'endDate', u'hander', u'isNew', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','interType': 'str','interName': 'str','busiType': 'str','hander': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqPreShareGet(preSecID = "", preTicker = "", secID = "", ticker = "", preYears = "", field = "", pandas = "1"):
    """
    1.优先股（preference share or preferred stock）释义：是相对于普通股 （common share）而言的，主要指在利润分红及剩余财产分配的权利方面，优先于普通股；2.表描述：记录新三板挂牌公司发行优先股的进展情况及优先股发行的必要基本信息。
    
    :param preSecID: 优先股证券ID。通联编制，可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,preSecID、preTicker、secID、ticker至少选择一个
    :param preTicker: 优先股交易代码，证券市场通用,可以是列表,preSecID、preTicker、secID、ticker至少选择一个
    :param secID: 发行公司证券ID。通联编制，可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,preSecID、preTicker、secID、ticker至少选择一个
    :param ticker: 发行公司交易代码，证券市场通用,可以是列表,preSecID、preTicker、secID、ticker至少选择一个
    :param preYears: 发行年度，输入格式“YYYYMMDD”，如20161231，20171231,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqPreShare.csv?ispandas=1&') 
    requestString.append("preSecID=")
    if hasattr(preSecID,'__iter__') and not isinstance(preSecID, str):
        if len(preSecID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = preSecID
            requestString.append(None)
        else:
            requestString.append(','.join(preSecID))
    else:
        requestString.append(preSecID)
    requestString.append("&preTicker=")
    if hasattr(preTicker,'__iter__') and not isinstance(preTicker, str):
        if len(preTicker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = preTicker
            requestString.append(None)
        else:
            requestString.append(','.join(preTicker))
    else:
        requestString.append(preTicker)
    requestString.append("&secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&preYears=")
    if hasattr(preYears,'__iter__') and not isinstance(preYears, str):
        if len(preYears) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = preYears
            requestString.append(None)
        else:
            requestString.append(','.join(preYears))
    else:
        requestString.append(preYears)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqPreShareGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqPreShareGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'preSecID', u'preTicker', u'preShortName', u'secID', u'ticker', u'secShortName', u'preYears', u'issueObj', u'isCovMainshare', u'projChg', u'planPublishDate', u'sasacApprPubDate', u'shcPublishDate', u'cbrcApprPubDate', u'porcApprPubDate', u'srcApprPubDate', u'beginDate', u'relWay', u'listingDate', u'subsStyle', u'initialPriceUp', u'initialPriceDown', u'prePrice', u'currCD', u'preVolUp', u'preVolDown', u'preVol', u'initialFunds', u'relFunds', u'parValue', u'initialCDy', u'diyType', u'diyNote', u'annualDivPay', u'isShcCancelPay', u'isDivAccu', u'isReturn', u'putProvisions', u'isRedeem', u'isDisSurPro', u'isEnded', u'isSplit', u'isPublish', u'isPublic', u'isParPrice', u'isAgreement', u'isRedeemEarly', u'isVoteRights', u'isDivForce', u'isChange', u'disSurProWay', u'redeemRight', u'isChangeOrd', u'initialChangePrice', u'isChangeForce', u'exchangeNote', u'isEquInclude', u'capDes', u'priceStan', u'others', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'preSecID': 'str','preTicker': 'str','preShortName': 'str','secID': 'str','ticker': 'str','secShortName': 'str','issueObj': 'str','isCovMainshare': 'str','projChg': 'str','relWay': 'str','subsStyle': 'str','initialCDy': 'str','diyType': 'str','diyNote': 'str','annualDivPay': 'str','isShcCancelPay': 'str','isDivAccu': 'str','isReturn': 'str','putProvisions': 'str','isRedeem': 'str','isDisSurPro': 'str','isEnded': 'str','isSplit': 'str','isPublish': 'str','isPublic': 'str','isParPrice': 'str','isAgreement': 'str','isRedeemEarly': 'str','isVoteRights': 'str','isDivForce': 'str','isChange': 'str','disSurProWay': 'str','redeemRight': 'str','isChangeOrd': 'str','isChangeForce': 'str','exchangeNote': 'str','isEquInclude': 'str','capDes': 'str','priceStan': 'str','others': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqShareEmployeesGet(partyID = "", partyName = "", beginDate = "", endDate = "", infoType = "", field = "", pandas = "1"):
    """
    1.记录新三板挂牌公司的员工构成信息；2.数据范围：挂牌、报告期；3.构成要素：总员工人数、学历构成、职位构成、其他。
    
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,partyID、partyName至少选择一个
    :param partyName: 公司全称，支持模糊查询,partyID、partyName至少选择一个
    :param beginDate: 起始查询日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止查询日期，输入格式“YYYYMMDD”,可空
    :param infoType: 分类标准。1-职能，2-学历，3-总数,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqShareEmployees.csv?ispandas=1&') 
    requestString.append("partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    if not isinstance(partyName, str) and not isinstance(partyName, unicode):
        partyName = str(partyName)

    requestString.append("&partyName=%s"%(partyName))
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&infoType=")
    if hasattr(infoType,'__iter__') and not isinstance(infoType, str):
        if len(infoType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = infoType
            requestString.append(None)
        else:
            requestString.append(','.join(infoType))
    else:
        requestString.append(infoType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqShareEmployeesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqShareEmployeesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'partyID', u'partyShortName', u'partyFullName', u'endDate', u'infoType', u'typeValue', u'personNum', u'ratio', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'partyShortName': 'str','partyFullName': 'str','infoType': 'str','typeValue': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def NeeqMainShTenGet(secID = "", ticker = "", partyID = "", beginDate = "", endDate = "", type = "", field = "", pandas = "1"):
    """
    记录在不同阶段持有新三板挂牌公司股份前十名的股东的持股情况。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000002.XSHE。可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表,secID、ticker、partyID至少选择一个
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,secID、ticker、partyID至少选择一个
    :param partyID: 通联编制的机构编码，可在DataAPI.PartyIDGet接口获取。,可以是列表,secID、ticker、partyID至少选择一个
    :param beginDate: 起始日期，输入格式“YYYYMMDD”,可空
    :param endDate: 截止日期，输入格式“YYYYMMDD”,可空
    :param type: 股东类型。1-个人，2-公司。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/neeq/getNeeqMainShTen.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&partyID=")
    if hasattr(partyID,'__iter__') and not isinstance(partyID, str):
        if len(partyID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = partyID
            requestString.append(None)
        else:
            requestString.append(','.join(partyID))
    else:
        requestString.append(partyID)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(type, str) and not isinstance(type, unicode):
        type = str(type)

    requestString.append("&type=%s"%(type))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'NeeqMainShTenGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=False)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'NeeqMainShTenGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'partyID', u'ticker', u'secShortName', u'endDate', u'shcName', u'type', u'holdVol', u'holdPct', u'holdCirVol', u'holdLimVol', u'shareType', u'shareCharType', u'note', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','shcName': 'str','type': 'str','shareType': 'str','shareCharType': 'str','note': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __MktOptionTickRTSnapshotGet(optionId = "", exchangeCD = "", field = "", pandas = "1"):
    """
    高频数据，获取ETF期权最新市场信息快照，包含上交所与深交所ETF期权的五档实时行情。
    
    :param optionId: 期权代码，如果为空，返回当前所有期权,可以是列表,可空
    :param exchangeCD: 交易市场代码，XSHG-上交所，XSHE-深交所,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getOptionTickRTSnapshot.csv?ispandas=1&') 
    requestString.append("optionId=")
    if hasattr(optionId,'__iter__') and not isinstance(optionId, str):
        if len(optionId) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = optionId
            requestString.append(None)
        else:
            requestString.append(','.join(optionId))
    else:
        requestString.append(optionId)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__MktOptionTickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__MktOptionTickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'bidBook_price1', u'bidBook_volume1', u'bidBook_price2', u'bidBook_volume2', u'bidBook_price3', u'bidBook_volume3', u'bidBook_price4', u'bidBook_volume4', u'bidBook_price5', u'bidBook_volume5', u'askBook_price1', u'askBook_volume1', u'askBook_price2', u'askBook_volume2', u'askBook_price3', u'askBook_volume3', u'askBook_price4', u'askBook_volume4', u'askBook_price5', u'askBook_volume5', u'optionId', u'timestamp', u'auctionPrice', u'auctionQty', u'dataDate', u'dataTime', u'dealAmount', u'highPrice', u'instrumentID', u'lastPrice', u'lowPrice', u'openPrice', u'origTime', u'preClosePrice', u'preSettlePrice', u'settlePrice', u'totalLongPosition', u'value', u'volume', u'exchangeCD', u'difPrice1', u'difPrice2']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'optionId': 'str','dataDate': 'str','dataTime': 'str','instrumentID': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __OptionTicksHistOneDayGet(optionId, date, startSecOffset = "", endSecOffset = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期权在历史上某一交易日内的Tick数据
    
    :param optionId: 期权代码
    :param date: 数据日期。格式是YYYYMMDD，如20130729，2013年7月29日。
    :param startSecOffset: 开始时间，相对8点的秒偏移量（>=0），若空，则表示开市时间。,可空
    :param endSecOffset: 结束时间，相对8点的秒偏移量(>=0)，若空，则表示闭市时间。,可空
    :param beginTime: 起始时间，输入格式"HH:MM"，如"09:30"，可精确到秒。,可空
    :param endTime: 结束时间，输入格式"HH:MM"，如"13:30"，可精确到秒。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getOptionTicksHistOneDay.csv?ispandas=1&') 
    if not isinstance(optionId, str) and not isinstance(optionId, unicode):
        optionId = str(optionId)

    requestString.append("optionId=%s"%(optionId))
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(startSecOffset, str) and not isinstance(startSecOffset, unicode):
        startSecOffset = str(startSecOffset)

    requestString.append("&startSecOffset=%s"%(startSecOffset))
    if not isinstance(endSecOffset, str) and not isinstance(endSecOffset, unicode):
        endSecOffset = str(endSecOffset)

    requestString.append("&endSecOffset=%s"%(endSecOffset))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__OptionTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__OptionTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'dataTimeMs', u'optionId', u'upTime', u'localTime', u'exchangeCD', u'secOffset', u'preSettlePrice', u'preClosePrice', u'settlePrice', u'openPrice', u'volume', u'value', u'dealAmount', u'highPrice', u'lowPrice', u'lastPrice', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5', u'auctionPrice', u'auctionQty', u'origTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','dataTimeMs': 'str','optionId': 'str','localTime': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FutureL1TransactionOneClearingDayGet(instrumentID, date, field = "", pandas = "1"):
    """
    高频数据，获取一只期货，在历史上某一清算日的分笔成交
    
    :param instrumentID: 一个期货合约代码，如A1009（大小写均可）;也可以是期货合约类型，如A，此时表示查主力合约。
    :param date: 日期，格式如20130719，注意这里表示的是清算日
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureL1TransactionOneClearingDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FutureL1TransactionOneClearingDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FutureL1TransactionOneClearingDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'dataMillisec', u'instrumentID', u'exchangeCD', u'volume', u'lastPrice', u'clearingDay', u'intsCHG', u'side', u'type']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','instrumentID': 'str','exchangeCD': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __OptionBarRTIntraDayGet(optionId, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取当日期权分钟线。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param optionId: 期权代码
    :param startTime: 开始时间，如果为空则是前一天的20:00（前一天夜盘开始时间）,可空
    :param endTime: 结束时间，例如14:20，如果为空则是当前时间,可空
    :param unit: Bar(s)的时间宽度，单位分钟，仅包含1分钟,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getOptionBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(optionId, str) and not isinstance(optionId, unicode):
        optionId = str(optionId)

    requestString.append("optionId=%s"%(optionId))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__OptionBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__OptionBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'optionId', u'exchangeCD', u'utcOffset', u'currencyCD', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'optionId': 'str','exchangeCD': 'str','utcOffset': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __OptionBarHistOneDayGet(optionId, date, field = "", pandas = "1"):
    """
    高频数据，获取一只或者多只期权在历史某一日的分钟线数据。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param optionId: 期货代码，支持多值输入,可以是列表
    :param date: 查询日期，以清算日为准，例如20140210，会返回20140209的夜盘和20140210的日盘
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getOptionBarHistOneDay.csv?ispandas=1&') 
    requestString.append("optionId=")
    if hasattr(optionId,'__iter__') and not isinstance(optionId, str):
        if len(optionId) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = optionId
            requestString.append(None)
        else:
            requestString.append(','.join(optionId))
    else:
        requestString.append(optionId)
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__OptionBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__OptionBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'optionId', u'unit', u'barTime', u'dataDate', u'exchangeCD', u'closePrice', u'openPrice', u'currencyCD', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue', u'totalLongPosition']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'optionId': 'str','barTime': 'str','exchangeCD': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __OptionBarHistDateRangeGet(optionId, startDate, endDate, field = "", pandas = "1"):
    """
    高频数据，获取一只期权在历史某个日期段内的分钟线数据。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param optionId: 期权代码
    :param startDate: 起始日期，需与结束日期在同一个月
    :param endDate: 结束日期，需与起始日期在同一个月
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getOptionBarHistDateRange.csv?ispandas=1&') 
    if not isinstance(optionId, str) and not isinstance(optionId, unicode):
        optionId = str(optionId)

    requestString.append("optionId=%s"%(optionId))
    if not isinstance(startDate, str) and not isinstance(startDate, unicode):
        startDate = str(startDate)

    requestString.append("&startDate=%s"%(startDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__OptionBarHistDateRangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__OptionBarHistDateRangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'optionId', u'exchangeCD', u'currencyCD', u'totalLongPosition', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue', u'dataDate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'optionId': 'str','exchangeCD': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __DeltaTickRTIntraDayGet(securityID, field = "", pandas = "1"):
    """
    获取一只股票最新10条分笔成交
    
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所，XHKG-香港交易所。
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getDeltaTickRTIntraDay.csv?ispandas=1&') 
    if not isinstance(securityID, str) and not isinstance(securityID, unicode):
        securityID = str(securityID)

    requestString.append("securityID=%s"%(securityID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__DeltaTickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__DeltaTickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'exchangeCD', u'dataTime', u'deltaVolume', u'lastPrice', u'deltaPrice', u'side']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','dataTime': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqStockTicksHistOneDayGet(ticker, date, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只新三板证券在历史上某一天内的Tick数据。 输入一只证券交易代码，如400002（长白5）。
    
    :param ticker: 证券6位代码， 如400002,可以是列表
    :param date: 数据日期。格式是YYYYMMDD。
    :param startTime: 交易起始时间。输入格式为hh:mm,可空
    :param endTime: 交易截止时间。输入格式为hh:mm,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getNeeqStockTicksHistOneDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqStockTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqStockTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'shortNm', u'ticker', u'timeOffset', u'dataTime', u'askPrice1', u'askPrice2', u'askPrice3', u'askPrice4', u'askPrice5', u'askVolume1', u'askVolume2', u'askVolume3', u'askVolume4', u'askVolume5', u'bidPrice1', u'bidPrice2', u'bidPrice3', u'bidPrice4', u'bidPrice5', u'bidVolume1', u'bidVolume2', u'bidVolume3', u'bidVolume4', u'bidVolume5', u'highPrice', u'lastPrice', u'localTime', u'lowPrice', u'openPrice', u'preclosePrice', u'seqNo', u'statusCode', u'value', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','shortNm': 'str','ticker': 'str','timeOffset': 'str','dataTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqIndexTicksHistOneDayGet(ticker, date, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只新三板证券在历史上某一天内的Tick数据。 输入一只指数交易代码，如899001（三板成指）。
    
    :param ticker: 指数6位代码， 如899001,可以是列表
    :param date: 数据日期。格式是YYYYMMDD。
    :param startTime: 交易起始时间。输入格式为hh:mm,可空
    :param endTime: 交易截止时间。输入格式为hh:mm,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getNeeqIndexTicksHistOneDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqIndexTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqIndexTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'shortNm', u'ticker', u'timeOffset', u'dataTime', u'highPrice', u'lastPrice', u'localTime', u'lowPrice', u'openPrice', u'preclosePrice', u'seqNo', u'statusCode', u'value', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'shortNm': 'str','ticker': 'str','timeOffset': 'str','dataTime': 'str','localTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqTransactionTicksHistOneDayGet(ticker, date, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只新三板证券在历史上某一天内的协议成交数据，输入一只证券交易代码，如831850（分豆教育）
    
    :param ticker: 证券6位代码， 如400002,可以是列表
    :param date: 数据日期。格式是YYYYMMDD。
    :param startTime: 交易起始时间。输入格式为hh:mm,可空
    :param endTime: 交易截止时间。输入格式为hh:mm,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getNeeqTransactionTicksHistOneDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqTransactionTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqTransactionTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'localTime', u'orderTime', u'price', u'recordStatus', u'seqNo', u'transactionType', u'transactionUnit', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','ticker': 'str','localTime': 'str','orderTime': 'str','recordStatus': 'str','transactionType': 'str','transactionUnit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NOBBTickRTIntraDayGet(ticker, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只新三板股票当日内时间段的tick信息。
    
    :param ticker: 证券6位代码， 如400002,可以是列表
    :param startTime: 开始时间，必须大于等于09:25，例如10:05，如果为空则是09:25,可空
    :param endTime: 结束时间，必须小于等于15:05，例如14:20，如果为空则是15：05,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getNOBBTickRTIntraDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NOBBTickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NOBBTickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'shortNm', u'ticker', u'askPrice1', u'askPrice2', u'askPrice3', u'askPrice4', u'askPrice5', u'askVolume1', u'askVolume2', u'askVolume3', u'askVolume4', u'askVolume5', u'bigPrice1', u'bigPrice2', u'bigPrice3', u'bigPrice4', u'bigPrice5', u'bigVolume1', u'bigVolume2', u'bigVolume3', u'bigVolume4', u'bigVolume5', u'deal', u'highPrice', u'lastPrice', u'lowPrice', u'openPrice', u'preclosePrice', u'value', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','shortNm': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __TickNOBBRTSnapshotGet(ticker, field = "", pandas = "1"):
    """
    高频数据，获取一只或多只新三板股票最新tick信息。 输入一只或多只证券代码，如000001，还有所选字段， 得到证券的最新交易快照。
    
    :param ticker: 证券6位代码， 如400002,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getTickNOBBRTSnapshot.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__TickNOBBRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__TickNOBBRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'askBook_price1', u'askBook_price2', u'askBook_price3', u'askBook_price4', u'askBook_price5', u'askBook_volume1', u'askBook_volume2', u'askBook_volume3', u'askBook_volume4', u'askBook_volume5', u'bidBook_price1', u'bidBook_price2', u'bidBook_price3', u'bidBook_price4', u'bidBook_price5', u'bidBook_volume1', u'bidBook_volume2', u'bidBook_volume3', u'bidBook_volume4', u'bidBook_volume5', u'dataTime', u'localTimestamp', u'ticker', u'timestamp', u'utcOffset', u'change', u'changePct', u'highPrice', u'lastPrice', u'lowPrice', u'openPrice', u'prevClosePrice', u'shortNM', u'value', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','localTimestamp': 'str','ticker': 'str','timestamp': 'str','utcOffset': 'str','shortNM': 'str','value': 'str','volume': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FutureL1TransactionIntraDayGet(instrumentID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期货当日内时间段分笔成交信息，包含瞬时成交量，瞬时仓差，买卖方向，开平仓性质等。
    
    :param instrumentID: 一个期货合约代码，如A1009（大小写均可）,可以是列表
    :param startTime: 交易开始时间，格式为HH:SS,可空
    :param endTime: 交易截止时间，格式为HH:SS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureL1TransactionIntraDay.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FutureL1TransactionIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FutureL1TransactionIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'clearingDay', u'dataTime', u'dataMillisec', u'offSet', u'exchangeCD', u'volume', u'lastPrice', u'intsCHG', u'side', u'type']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','clearingDay': 'str','exchangeCD': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HSITicksHistOneDayGet(tradeDate, ticker, field = "", pandas = "1"):
    """
    高频数据，获取一只恒生指数在历史某一个交易日的tick数据信息，包含开、高、低、收、成交金额等内容。
    
    :param tradeDate: 交易日期（年月日部分），格式是YYYYMMDD.
    :param ticker: 恒生指数代码，根据getIdx中porgFullName为"恒生指数有限公司"可获取到指数的代码。,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHSITicksHistOneDay.csv?ispandas=1&') 
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HSITicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HSITicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'updateTime', u'ticker', u'indexStatus', u'securityrName', u'dailyIndexHigh', u'dailyIndexLow', u'currentIndex', u'estamitedAveragePrice', u'indexTurnover', u'indexPointChange', u'indexPointChangePercent']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','indexStatus': 'str','securityrName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HSIBarHistOneDayGet(tradeDate, ticker, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只恒生指数在历史某一个交易日的分钟线数据信息，包含分钟内开、高、低、收、成交量、成交金额等内容。
    
    :param tradeDate: 交易日期（年月日部分），格式是YYYYMMDD.
    :param ticker: 恒生指数代码，根据getIdx中porgFullName为"恒生指数有限公司"可获取到指数的代码。,可以是列表
    :param startTime: 分钟起始时间，格式为HH:MM,可空
    :param endTime: 分钟截止时间，格式为HH:MM,可空
    :param unit: 分钟维度，可为1/5/15/30/60，不填写默认为1分钟线,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHSIBarHistOneDay.csv?ispandas=1&') 
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("tradeDate=%s"%(tradeDate))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HSIBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HSIBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'barTime', u'utcOffset', u'ticker', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'indexTurnover']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'barTime': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NOBBBarHistOneDayGet(ticker, tradeDate, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只新三板证券在历史某一个交易日的分钟线数据信息，包含分钟内开、高、低、收、成交量、成交金额等内容。
    
    :param ticker: 证券交易代码，如400002,可以是列表
    :param tradeDate: 交易日期（年月日部分），格式是YYYYMMDD.
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param unit: 分钟维度，可为1/5/15/30/60，不填写默认为1分钟线,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getNOBBBarHistOneDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NOBBBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NOBBBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'tradeDate', u'barTime', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'volume', u'value', u'vwap']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NOBBBarRTIntraDayOneMinuteGet(time, unit = "", assetClass = "", field = "", pandas = "1"):
    """
    高频数据，获取当日新三板所有股票某一分钟的分钟线数据，用户可输入分钟截止时间获取该分钟维度信息，包含开、高、低、收，成交量等，分钟维度包含1/5/15/30/60分钟线
    
    :param time: 查询时间，如09:33
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param assetClass: 通联编制的证券类别编码。例如，E-股票；IDX-指数。对应DataAPI.SysCodeGet.codeTypeID=10001。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getNOBBBarRTIntraDayOneMinute.csv?ispandas=1&') 
    if not isinstance(time, str) and not isinstance(time, unicode):
        time = str(time)

    requestString.append("time=%s"%(time))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NOBBBarRTIntraDayOneMinuteGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NOBBBarRTIntraDayOneMinuteGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'barTime', u'shortNM', u'utcOffset', u'currencyCD', u'totalVolume', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','barTime': 'str','shortNM': 'str','utcOffset': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NOBBBarRTIntraDayGet(ticker, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取当日新三板一只证券从开盘截至目前所有分钟线数据，包含开、高、低、收，成交量等，分钟维度包含1/5/15/30/60分钟线
    
    :param ticker: 证券在证券市场通用的交易代码。
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getNOBBBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NOBBBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NOBBBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'shortNM', u'utcOffset', u'currencyCD', u'barTime', u'totalVolume', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str','utcOffset': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HSITickRTSnapshotGet(ticker, field = "", pandas = "1"):
    """
    高频数据，获取一只或多只恒生指数最新市场信息快照，包含开、高、低、最新价以及成交量、成交金额等
    
    :param ticker: 恒生指数代码，根据getIdx中porgFullName为"恒生指数有限公司"可获取到指数的代码。,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHSITickRTSnapshot.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HSITickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HSITickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'shortNM', u'dataTime', u'utcOffset', u'status', u'highPrice', u'lowPrice', u'lastPrice', u'value', u'change', u'changePct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','shortNM': 'str','dataTime': 'str','utcOffset': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HSITickRTIntraDayGet(ticker, field = "", pandas = "1"):
    """
    高频数据，获取一只恒生指数在当日时间段内的tick数据，包含最新价、最高价、最低价、均价等
    
    :param ticker: 恒生指数代码，根据getIdx中porgFullName为"恒生指数有限公司"可获取到指数的代码。,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHSITickRTIntraDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HSITickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HSITickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'dataDate', u'shortNM', u'dataTime', u'status', u'currencyCd', u'highPrice', u'lowPrice', u'lastPrice', u'avgPrice', u'value', u'chg', u'changePct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','dataDate': 'str','shortNM': 'str','dataTime': 'str','currencyCd': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKTickRTIntraDayGet(ticker, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只港交所证券在当日时间段内的tick数据，当前仅包含港交所股票信息，涉及字段包含最新价，成交量，成交金额，当日最高价，当日最低价，买卖一档价格等等
    
    :param ticker: 证券在港交所的交易代码，如00001-长和
    :param startTime: 开始时间，格式为HH:MM,可空
    :param endTime: 结束时间，格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHKTickRTIntraDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKTickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKTickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'secOffset', u'currencyCD', u'ticker', u'shortNM', u'prevClosePrice', u'openPrice', u'volume', u'value', u'highPrice', u'lowPrice', u'lastPrice', u'bidPrice1', u'bidVolume1', u'askPrice1', u'askVolume1', u'tradType', u'IEP', u'aggQty', u'nominalPrice', u'vwap', u'chg', u'changePct', u'yield', u'tradStatus', u'bidPrice2', u'bidVolume2', u'askPrice2', u'askVolume2', u'bidPrice3', u'bidVolume3', u'askPrice3', u'askVolume3', u'bidPrice4', u'bidVolume4', u'askPrice4', u'askVolume4', u'bidPrice5', u'bidVolume5', u'askPrice5', u'askVolume5', u'bidPrice6', u'bidVolume6', u'askPrice6', u'askVolume6', u'bidPrice7', u'bidVolume7', u'askPrice7', u'askVolume7', u'bidPrice8', u'bidVolume8', u'askPrice8', u'askVolume8', u'bidPrice9', u'bidPrice10', u'bidVolume9', u'bidVolume10', u'askPrice9', u'askPrice10', u'askVolume9', u'askVolume10']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','secOffset': 'str','currencyCD': 'str','ticker': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FutureOptTicksHistOneDayGet(instrumentID, date, field = "", pandas = "1"):
    """
    高频数据，获取一只期货期权合约在历史某一个交易日内的Tick数据，包含最新价、开盘价、最高价、最低价、成交量、成交金额、买卖一档等信息
    
    :param instrumentID: 一个期权合约代码，如m1801-P-2650;
    :param date: 数据日期。格式是“YYYYMMDD”
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureOptTicksHistOneDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FutureOptTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FutureOptTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'dataDate', u'clearingDay', u'dataTime', u'exchangeCD', u'lastPrice', u'preSettlementPrice', u'prevClosePrice', u'preOpenInterest', u'openPrice', u'highPrice', u'lowPrice', u'volume', u'value', u'openInterest', u'closePrice', u'settlementPrice', u'upperLimitPrice', u'lowerLimitPrice', u'bidPrice1', u'bidVolume1', u'askPrice1', u'askVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5', u'tflag']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','exchangeCD': 'str','tflag': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __NeeqDeltaTickRTIntraDayGet(ticker, field = "", pandas = "1"):
    """
    高频数据，获取一只新三板股票最新的十笔分笔成交记录，包含最新10笔分笔的成交价格和成交数量，以及价格变动等信息
    
    :param ticker: 证券6位代码， 如400002,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getNeeqDeltaTickRTIntraDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__NeeqDeltaTickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__NeeqDeltaTickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'dataTime', u'deltaVolume', u'lastPrice', u'deltaPrice']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FutureOptTicksIntraDayGet(instrumentID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期货期权在本清算日（包含夜盘）内自交易开始的所有行情信息
    
    :param instrumentID: 一个期货期权合约代码，如m1709-P-3100(大小写均可)。
    :param startTime: 开始时间，如10:10，若空，则表示没有上界,可空
    :param endTime: 结束时间，如10:15，若空，则表示没有下界,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureOptTicksIntraDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FutureOptTicksIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FutureOptTicksIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'dataMillisec', u'milliSecOffset', u'exchangeCD', u'instrumentID', u'prevClosePrice', u'preSettlementPrice', u'preOpenInterest', u'openPrice', u'closePrice', u'volume', u'value', u'settlementPrice', u'openInterest', u'highPrice', u'lowPrice', u'lastPrice', u'upperLimitPrice', u'lowerLimitPrice', u'clearingDay', u'bidPrice1', u'bidVolume1', u'askPrice1', u'askVolume1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','exchangeCD': 'str','instrumentID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FutureOptTickRTSnapshotGet(instrumentID = "", field = "", pandas = "1"):
    """
    高频数据，获取期货期权最新市场信息快照
    
    :param instrumentID: 证券在证券市场通用的交易代码，如m1709-P-3100(大小写均可)。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureOptTickRTSnapshot.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FutureOptTickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FutureOptTickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'timestamp', u'dataDate', u'dataTime', u'dataMillisec', u'prevClosePrice', u'openPrice', u'volume', u'value', u'highPrice', u'lowPrice', u'lastPrice', u'exchangeCD', u'openInterest', u'preOpenInterest', u'upperLimitPrice', u'lowerLimitPrice', u'preSettlementPrice', u'settlementPrice', u'closePrice', u'clearingDay', u'bidBook_price1', u'bidBook_volume1', u'bidBook_price2', u'bidBook_volume2', u'bidBook_price3', u'bidBook_volume3', u'bidBook_price4', u'bidBook_volume4', u'bidBook_price5', u'bidBook_volume5', u'askBook_price1', u'askBook_volume1', u'askBook_price2', u'askBook_volume2', u'askBook_price3', u'askBook_volume3', u'askBook_price4', u'askBook_volume4', u'askBook_price5', u'askBook_volume5', u'milliSecOffset', u'localTimestamp', u'utcOffset']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','dataTime': 'str','exchangeCD': 'str','clearingDay': 'str','utcOffset': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FutureOptBarRTIntraDayGet(instrumentID, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取当日期货期权的分钟线，包含1/5/15/30/60分钟的分钟线。分钟线的有效数据从夜盘开始到日线结束，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，第一根分钟线包含时间范围为集合竞价开始到连续竞价开始
    
    :param instrumentID: 期货期权合约在证券市场通用的交易代码。
    :param startTime: 根据bar的时间范围查询的开始时间，默认是前一天的21:00（前一天夜盘开始时间）。格式"hh:mm"。,可空
    :param endTime: 根据bar的时间范围查询的结束时间，默认是当前时间。格式"hh:mm"。,可空
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureOptBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FutureOptBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FutureOptBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'unit', u'exchangeCD', u'utcOffset', u'currencyCD', u'barTime', u'totalVolume', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalValue', u'openInterest']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','exchangeCD': 'str','utcOffset': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __FutureOptBarHistOneDayGet(instrumentID, tradeDate, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或者多只商品期权在历史某一清算日的分钟线数据，包含1/3/5/15/30/60分钟的分钟线。分钟线的有效数据从夜盘开始到日线结束，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，第一根分钟线包含时间范围为集合竞价开始到连续竞价开始
    
    :param instrumentID: 合约在交易所的交易代码，如“m1707-C-2600”，最多允许输入5只合约,可以是列表
    :param tradeDate: 查询日期，以清算日为准，例如20170613，会返回20170612的夜盘和20170613的日盘
    :param startTime: 不输入默认查询当日开盘时间,可空
    :param endTime: 不输入默认查询当日收盘时间,可空
    :param unit: Bar(s)的时间宽度，单位分钟，如 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟），不输入默认返回1分钟线,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureOptBarHistOneDay.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__FutureOptBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__FutureOptBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'clearingDay', u'dataDate', u'instrumentID', u'exchangeCD', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue', u'openInterest']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','exchangeCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKTicksHistOneDayGet(ticker, tradeDate, field = "", pandas = "1"):
    """
    高频数据，获取一只港交所证券在历史上某一天内的Tick数据。 输入一只证券代码，如00001，即可获取长和的历史行情。
    
    :param ticker: 证券在证券市场通用的交易代码
    :param tradeDate: 格式是YYYYMMDD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHKTicksHistOneDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'dataTime', u'exchangeCD', u'currencyCD', u'prevClosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'volume', u'value', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'bidPrice6', u'bidVolume6', u'bidPrice7', u'bidVolume7', u'bidPrice8', u'bidVolume8', u'bidPrice9', u'bidVolume9', u'bidPrice10', u'bidVolume10', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5', u'askPrice6', u'askVolume6', u'askPrice7', u'askVolume7', u'askPrice8', u'askVolume8', u'askPrice9', u'askVolume9', u'askPrice10', u'askVolume10', u'tradeType', u'IEP', u'aggQty', u'nominalPrice', u'chg', u'chgPct', u'tradeStatus']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','exchangeCD': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKBarRTIntraDayGet(unit, ticker = "", startTime = "", endTime = "", assetClass = "", field = "", pandas = "1"):
    """
    高频数据，获取一只港交所证券当日的分钟线信息，包含1/3/5/15/30/60分钟的分钟线。 证券目前仅包含股票。分钟线的有效数据上午从09：30 到12：30（随机收市，分钟线计算至12:30），下午从13：01到16：30（随机收市，分钟线计算至16:30），分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param assetClass: 通联编制的证券类别编码。例如，E-股票；B-债券；F-基金等。对应DataAPI.SysCodeGet.codeTypeID=10001。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHKBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("unit=%s"%(unit))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'shortNM', u'utcOffset', u'currencyCD', u'barTime', u'totalVolume', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str','utcOffset': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HSIBarRTIntraDayGet(unit, ticker = "", startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只恒生指数当日的分钟线信息，包含1/3/5/15/30/60分钟的分钟线。分钟线的有效数据上午从09：30 到12：30（随机收市，分钟线计算至12:30），下午从13：01到16：30（随机收市，分钟线计算至16:30），分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）
    :param ticker: 恒生指数代码，根据getIdx中porgFullName为"恒生指数有限公司"可获取到指数的代码。,可以是列表,可空
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHSIBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("unit=%s"%(unit))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HSIBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HSIBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'shortNM', u'currencyCD', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __EnergyFutureTicksHistOneDayGet(instrumentID, tradeDate, field = "", pandas = "1"):
    """
    高频数据，获取一只上海国际能源交易中心期货合约在历史某一清算日内的Tick数据。目前仅包含上期能源原油期货（品种尚未上市，数据为测试数据）
    
    :param instrumentID: 证券在证券市场通用的交易代码。
    :param tradeDate: 清算日期
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getEnergyFutureTicksHistOneDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__EnergyFutureTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__EnergyFutureTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'clearingDay', u'dataDate', u'dataTime', u'dataMillisec', u'instrumentID', u'preOpenInterest', u'preSettlementPrice', u'prevClosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'closePrice', u'settlementPrice', u'openInterest', u'volume', u'value', u'upperLimitPrice', u'lowerLimitPrice', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'tflag']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','tflag': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKBarHistOneDayGet(ticker, tradeDate, unit = "", startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只港交所股票在历史某一日的分钟线信息，包含1/3/5/15/30/60分钟的分钟线。 输入一只证券代码，如00001（长和）， 得到这只证券在历史某一日的分钟线数据。 分钟线的有效数据上午从09：30 到12：30（随机收市，分钟线计算延迟到12:30），下午从13：01到16：30（随机收市，分钟线计算延迟到16:30），分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表
    :param tradeDate: 查询日期，格式YYYYMMDD
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/3(分钟)/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即16:30，不选即为默认值,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHKBarHistOneDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'shortNM', u'currencyCD', u'unit', u'ticker', u'barTime', u'closePrice', u'dataDate', u'highPrice', u'lowPrice', u'openPrice', u'totalValue', u'totalVolume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','shortNM': 'str','currencyCD': 'str','ticker': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __HKTickRTSnapshotGet(ticker = "", assetClass = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只港交所证券最新市场信息快照。 输入一只或多只证券交易代码，如000001,并指定其证券品种,如"E"(目前支持股票，牛熊证，基金，权证，部分债券),即可获取长和的最新市场信息快照
    
    :param ticker: 证券在证券市场通用的交易代码,不输入返回全市场证券,可以是列表,可空
    :param assetClass: 通联编制的证券类别编码。例如，E-股票；B-债券；F-基金等。对应DataAPI.SysCodeGet.codeTypeID=10001。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHKTickRTSnapshot.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__HKTickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__HKTickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'currencyCD', u'prevClosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'nominalPrice', u'volume', u'value', u'askBook', u'bidBook', u'change', u'changePct', u'amplitude', u'VWAP', u'AggQty', u'IEP', u'tradSessionStatus', u'tradSessionID', u'tradSessionSubID', u'tradStatus', u'tradType', u'timestamp', u'localTimestamp']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','ticker': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __OptTickIntraDayGet(instrumentID = "", optID = "", startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取一只ETF期权合约在当日内Tick数据
    
    :param instrumentID: 合约在交易所的交易代码，如“510050C1803M02500”,instrumentID、optID至少选择一个
    :param optID: 期权代码，交易所期权编码,可以是列表,instrumentID、optID至少选择一个
    :param startTime: 起始查询时间，格式为HH:MM，可支持到秒,可空
    :param endTime: 截止查询时间，格式为HH:MM，可支持到秒,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getOptTickIntraDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    requestString.append("&optID=")
    if hasattr(optID,'__iter__') and not isinstance(optID, str):
        if len(optID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = optID
            requestString.append(None)
        else:
            requestString.append(','.join(optID))
    else:
        requestString.append(optID)
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__OptTickIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__OptTickIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'optID', u'dataDate', u'dataTime', u'secOffset', u'preClosePrice', u'preSettlePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'settlePrice', u'volume', u'value', u'totalLongPosition', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5', u'auctionPrice', u'autionQty', u'dealAmount', u'exchangeCD', u'difPrice1', u'difPrice2']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __DYComIndexRTSnapshotGet(ticker = "", field = "", pandas = "1"):
    """
    获取通联自主计算商品指数，目前包含47个单品种指数，11个品类指数以及1个综合指数，计算采用持仓量加权，分钟更新，需注意：因为是实时计算，当日分钟线最高价会比根据日线计算的最高价低，同理当日分钟线最低价会比根据日线计算的最低价高，因日线获取到的最高价是每个合约的最高价，而实时获取时，A合约出现最高价时B合约未必处于最高价，同理最低价。
    
    :param ticker: 指数代码，可从DataAPI.SecIDGet获取到,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getDYComIndexRTSnapshot.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__DYComIndexRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__DYComIndexRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'indexType', u'utcOffset', u'ticker', u'secShortName', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'closePrice', u'volume', u'value']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','utcOffset': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SSEBondDpoHistOneDayGet(ticker, tradeDate, field = "", pandas = "1"):
    """
    获取上交所固收平台证券当日基本信息，包含证券代码、 交易产品、 证券属性、 证券状态、证券发行方式 、证券面额 、发行价格等信息，每5分钟更新一次
    
    :param ticker: 证券在交易所的交易代码
    :param tradeDate: 交易日期，格式为YYYMMDD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSSEBondDpoHistOneDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SSEBondDpoHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SSEBondDpoHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'tradeTime', u'ticker', u'secShortName', u'bondType', u'bondProperty', u'bondstatusCD', u'pleTickerSymbol', u'openTime', u'closeTime', u'issueModeCD', u'par', u'issuePrice', u'intType', u'cpnFreqCD', u'coupon', u'primeRate', u'basicSpread', u'maturity', u'actualTenderSize', u'issueBeginDate', u'issueEndDate', u'listDate', u'maturityDate', u'treasuryType', u'underWritingMethod', u'isCrossMkt', u'isShort', u'shortSize', u'brokerShortSize', u'preClosePrice', u'preWPrice']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeTime': 'str','ticker': 'str','secShortName': 'str','bondType': 'str','bondProperty': 'str','bondstatusCD': 'str','pleTickerSymbol': 'str','openTime': 'str','closeTime': 'str','issueModeCD': 'str','intType': 'str','cpnFreqCD': 'str','treasuryType': 'str','underWritingMethod': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SSEBondFirmQuoteHistOneDayGet(ticker, tradeDate, field = "", pandas = "1"):
    """
    获取上交所固收平台证券确定报价信息，包括证券代码、 证券简称、买卖价位深度数量、到期收益率等，在报价记录中，数量为当前剩余数量，如果是冰山订单，则当实际数量大于冰山订单值，在数量一栏显示冰山订单值，而不是实际数量，在报价记录中，如果是匿名报价，则在报价方一栏显示“匿名”，数据每5秒更新一次
    
    :param ticker: 证券在交易所的交易代码
    :param tradeDate: 交易日期，格式为YYYMMDD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSSEBondFirmQuoteHistOneDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SSEBondFirmQuoteHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SSEBondFirmQuoteHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'tradeTime', u'ticker', u'secShortName', u'bidNo', u'bidTime', u'bidBroker', u'netBidPrice', u'bidVolume', u'grossBidPrice', u'bidYTM', u'askNo', u'askTime', u'askBroker', u'netAskPrice', u'askVolume', u'grossAskPrice', u'askTYTM', u'AI']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeTime': 'str','ticker': 'str','secShortName': 'str','bidNo': 'str','bidTime': 'str','bidBroker': 'str','askNo': 'str','askTime': 'str','askBroker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SSEBondPriceHistOneDayGet(ticker, tradeDate, field = "", pandas = "1"):
    """
    获取上交所固收平台证券成交行情信息，包含当日开、高、低、收、加权平均价、开盘收益率、收盘收益率等信息，每个证券的统计行情包含了由确定报价、待定报价、询价或者是场务应急录入等方式达成的成交，但不包括协议交易的成交，数据每5秒更新一次
    
    :param ticker: 证券在交易所的交易代码
    :param tradeDate: 交易日期，格式为YYYMMDD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSSEBondPriceHistOneDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SSEBondPriceHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SSEBondPriceHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'tradeTime', u'updatetime', u'ticker', u'secShortName', u'preClosePrice', u'preWPrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'wPrice', u'volume', u'value', u'deal', u'preCloseRate', u'preWRate', u'openRate', u'highRate', u'lowRate', u'lastRate', u'wRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeTime': 'str','updatetime': 'str','ticker': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SSEBondTransHistOneDayGet(ticker, tradeDate, field = "", pandas = "1"):
    """
    获取上交所固收平台证券成交明细信息，包含成交净价、成交全价、应计利息、到期收益率等信息，成交明细中包含了由确定报价、待定报价、询价、场务应急录入、协议交易、指定对手方等方式达成的成交，不包含私募债券成交数据，数据每5秒更新一次
    
    :param ticker: 证券在交易所的交易代码
    :param tradeDate: 交易日期，格式为YYYMMDD
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSSEBondTransHistOneDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SSEBondTransHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SSEBondTransHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'tradeTime', u'updateDate', u'updateTime', u'ticker', u'secShortName', u'netPrice', u'AI', u'grossPrice', u'YTM', u'volume', u'value', u'type']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'tradeTime': 'str','updateTime': 'str','ticker': 'str','secShortName': 'str','type': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SSEBondPriceRTSnapshotGet(ticker = "", field = "", pandas = "1"):
    """
    获取一只上交所固定收益证券最新市场信息快照，包含开盘价、最高价、最低价、最新价、开盘、最高、最低以及收盘收益率等
    
    :param ticker: 证券代码，证券在交易所的交易代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSSEBondPriceRTSnapshot.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SSEBondPriceRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SSEBondPriceRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'updateDate', u'tradeTime', u'updateTime', u'ticker', u'shortNM', u'preClosePrice', u'preWPrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'wPrice', u'value', u'volume', u'deal', u'preCloseRate', u'preWRate', u'openRate', u'highRate', u'lowRate', u'lastRate', u'wRate']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'updateDate': 'str','tradeTime': 'str','updateTime': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __IndustryPriceRTIntraDayGet(industryID = "", industryName = "", field = "", pandas = "1"):
    """
    获取行业板块当日内Tick信息，包含申万一二三级行业，涵盖开、高、低、最新价、领涨股等信息
    
    :param industryID: 行业ID，申万行业代码，可在getIndustry获取,industryID、industryName至少选择一个
    :param industryName: 行业中文名称,industryID、industryName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getIndustryPriceRTIntraDay.csv?ispandas=1&') 
    if not isinstance(industryID, str) and not isinstance(industryID, unicode):
        industryID = str(industryID)

    requestString.append("industryID=%s"%(industryID))
    if not isinstance(industryName, str) and not isinstance(industryName, unicode):
        industryName = str(industryName)

    requestString.append("&industryName=%s"%(industryName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__IndustryPriceRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__IndustryPriceRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'industryID', u'industryName', u'preclosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'volume', u'value', u'chgPct', u'ticker', u'upNum', u'downNum', u'equalNum', u'upLimitCount', u'downLimitCount', u'turnoverRate', u'netInflow', u'netMainInflow', u'chgPct5', u'chgPct10', u'chgPct20', u'chgPctFY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','industryName': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __DCEComIdxRTIntraDayGet(ticker, field = "", pandas = "1"):
    """
    获取大商所指数在当日内的Tick信息，包含指数代码，指数前收盘价、前结算价、开、高、低、收价等
    
    :param ticker: 指数交易代码，可以在接口DataAPI.SecIDGet中获取，令asset=IDX&partyID=27144，可获取到所有大商所指数的代码，去掉交易代码中的“DC”即可，如大商所豆粕期货价格指数在DataAPI.SecIDGet接口查询到的代交易代码为DCPFSM01，此处输入PFSM01
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getDCEComIdxRTIntraDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__DCEComIdxRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__DCEComIdxRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'clearingDay', u'dataTime', u'ticker', u'IndexName', u'preClosePrice', u'preSettlePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'avgPrice', u'closePrice', u'SettlePrice', u'chg', u'chgPct', u'volume', u'value']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','ticker': 'str','IndexName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __SHSZDeltaTickRTIntraDayGet(ticker = "", exchangeCD = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取沪深一只或多只证券在当日内的分笔信息，包含当前价格，瞬时成交量，价格变动(相对上一根Tick)等
    
    :param ticker: 证券交易代码,可以是列表,ticker、exchangeCD至少选择一个
    :param exchangeCD: 交易市场,可以是列表,ticker、exchangeCD至少选择一个
    :param beginTime: 查询开始时间，格式为HH:MM:SS,可空
    :param endTime: 查询结束时间，格式为HH:MM:SS,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZDeltaTickRTIntraDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__SHSZDeltaTickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__SHSZDeltaTickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'datadate', u'datatime', u'ticker', u'secOffset', u'exchangecd', u'secShortName', u'volume', u'price', u'deltaPrice', u'side']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'datatime': 'str','ticker': 'str','exchangecd': 'str','secShortName': 'str','side': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __AHCompRTIntraDayGet(partyID = "", tickerA = "", tickerH = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取A股与H股在当日内的比价信息，包含A股与H股的比率与H股占A股比例，其中汇率以外汇交易中心公布的中间价为基准
    
    :param partyID: 公司ID，可从接口DataAPI.PartyIDGet获取,partyID、tickerA、tickerH至少选择一个
    :param tickerA: A股证券交易代码,partyID、tickerA、tickerH至少选择一个
    :param tickerH: H股证券交易代码,partyID、tickerA、tickerH至少选择一个
    :param beginTime: 查询起始时间，格式为hh:mm:ss,可空
    :param endTime: 查询结束时间，格式为hh:mm:ss,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getAHCompRTIntraDay.csv?ispandas=1&') 
    if not isinstance(partyID, str) and not isinstance(partyID, unicode):
        partyID = str(partyID)

    requestString.append("partyID=%s"%(partyID))
    if not isinstance(tickerA, str) and not isinstance(tickerA, unicode):
        tickerA = str(tickerA)

    requestString.append("&tickerA=%s"%(tickerA))
    if not isinstance(tickerH, str) and not isinstance(tickerH, unicode):
        tickerH = str(tickerH)

    requestString.append("&tickerH=%s"%(tickerH))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__AHCompRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__AHCompRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'secOffset', u'partyID', u'tickerA', u'tickerH', u'lastPriceA', u'lastPriceH', u'lastPriceHA', u'chgPctA', u'chgPctH', u'AHRatio', u'HARatio', u'volumeA', u'volumeH']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','tickerA': 'str','tickerH': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ThemeDeltaPriceGet(themeID, field = "", pandas = "1"):
    """
    获取某一主题板块在当日内的分笔成交信息，包含成交价格及成交量
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getThemeDeltaPrice.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ThemeDeltaPriceGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ThemeDeltaPriceGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'themeID', u'themeName', u'lastPrice', u'volume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','themeName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __DCEComIdxRTSnapshotGet(instrumentID = "", field = "", pandas = "1"):
    """
    高频数据，获取大商所商品指数的最新交易快照。具体包括期货价格指数、期货主力合约价格指数、农产品指数等的高开低收、涨跌幅、历史最高最低价、成交金额与成交量等信息。
    
    :param instrumentID: 指数代码，可多值输入，不可不输。代码基本信息可通过字母大写并前缀DC传入DataAPI.SecIDGet接口获取到，如代码“pfsm02”，在DataAPI.SecIDGet接口输入ticker=DCPFSM02即可获取。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getDCEComIdxRTSnapshot.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__DCEComIdxRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__DCEComIdxRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'avgPrice', u'changePrice', u'changeRate', u'clearPrice', u'clearingDay', u'closePrice', u'dataDate', u'dataTime', u'exchangeCD', u'highPrice', u'instrumentID', u'instrumentName', u'lastClearPrice', u'lastClose', u'lastPrice', u'lifeHigh', u'lifeLow', u'lowPrice', u'openPrice', u'turnover', u'volume', u'timestamp']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'clearingDay': 'str','dataDate': 'str','dataTime': 'str','exchangeCD': 'str','instrumentID': 'str','instrumentName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __IdxConsTickRTSnapshotGet(ticker = "", indexType = "", field = "", pandas = "1"):
    """
    获取沪深指数实时指标最新快照，指标值根据成份股衍生计算，包括指数总市值、指数PE、换手率、涨平跌成份股数等。
    
    :param ticker: 证券在证券市场通用的交易代码,不输入返回全市场证券,可以是列表,ticker、indexType至少选择一个
    :param indexType: 指数类型，用于按类型查询指数。sh-上交所，sz-深交所，csi-中证，sw-申万,可以是列表,ticker、indexType至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getIdxConsTickRTSnapshot.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&indexType=")
    if hasattr(indexType,'__iter__') and not isinstance(indexType, str):
        if len(indexType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = indexType
            requestString.append(None)
        else:
            requestString.append(','.join(indexType))
    else:
        requestString.append(indexType)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__IdxConsTickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__IdxConsTickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'shortNM', u'MarketValue', u'PETTM', u'turnoverRate', u'upNum', u'downNum', u'equalNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','ticker': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktTickRTSnapshotGet(securityID = "", ticker = "", assetClass = "", exchangeCD = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只证券最新Level1股票信息。 输入一只或多只证券代码，如000001.XSHG (上证指数） 或000001.XSHE（平安银行）， 还有所选字段， 得到证券的最新交易快照。 证券可以是股票，指数， 部分债券或 基金。
    
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所，XHKG-香港交易所。,可以是列表,securityID、ticker至少选择一个
    :param ticker: 证券在证券市场通用的交易代码，可选参数，允许多值逗号分隔,可以是列表,securityID、ticker至少选择一个
    :param assetClass: 通联编制的证券类别编码。例如，E-股票；B-债券；F-基金；FU-期货等。对应DataAPI.SysCodeGet.codeTypeID=10001。,可以是列表,可空
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getTickRTSnapshot.csv?ispandas=1&') 
    requestString.append("securityID=")
    if hasattr(securityID,'__iter__') and not isinstance(securityID, str):
        if len(securityID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = securityID
            requestString.append(None)
        else:
            requestString.append(','.join(securityID))
    else:
        requestString.append(securityID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&assetClass=")
    if hasattr(assetClass,'__iter__') and not isinstance(assetClass, str):
        if len(assetClass) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = assetClass
            requestString.append(None)
        else:
            requestString.append(','.join(assetClass))
    else:
        requestString.append(assetClass)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktTickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktTickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'timestamp', u'ticker', u'exchangeCD', u'localTimestamp', u'dataDate', u'dataTime', u'shortNM', u'utcOffset', u'currencyCD', u'prevClosePrice', u'openPrice', u'volume', u'value', u'deal', u'highPrice', u'lowPrice', u'lastPrice', u'bidBook_price1', u'bidBook_volume1', u'bidBook_price2', u'bidBook_volume2', u'bidBook_price3', u'bidBook_volume3', u'bidBook_price4', u'bidBook_volume4', u'bidBook_price5', u'bidBook_volume5', u'askBook_price1', u'askBook_volume1', u'askBook_price2', u'askBook_volume2', u'askBook_price3', u'askBook_volume3', u'askBook_price4', u'askBook_volume4', u'askBook_price5', u'askBook_volume5', u'suspension', u'tradType', u'IEP', u'AggQty', u'nominalPrice', u'VWAP', u'change', u'changePct', u'Yield', u'tradStatus', u'tradSessionID', u'tradSessionSubID', u'tradSessionStatus', u'orderType', u'smallOrderValue', u'mediumOrderValue', u'largeOrderValue', u'extraLargeOrderValue', u'totalOrderValue', u'amplitude', u'turnoverRate', u'negMarketValue', u'staticPE', u'forwardPE']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','dataDate': 'str','dataTime': 'str','shortNM': 'str','utcOffset': 'str','currencyCD': 'str','orderType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktTickRTSnapshotIndexGet(securityID, field = "", pandas = "1"):
    """
    高频数据，获取一个指数的成分股的最新Level1股票信息。 输入一个指数的证券代码，如000001.XSHG (上证指数） 或000300.XSHG（沪深300）， 还有所选字段， 得到指数成分股的最新交易快照。
    
    :param securityID: 一个指数的证券代码，用,分隔，格式是“数字.交易所代码”，如000001.XSHG。目前支持的指数是：000001.XSHG（上证指数），000010.XSHG（上证180），000016.XSHG（上证50），000300.XSHG（沪深300）,000903.XSHG（中证100），000905.XSHG（中证500）,000906.XSHG（中证800）
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getTickRTSnapshotIndex.csv?ispandas=1&') 
    if not isinstance(securityID, str) and not isinstance(securityID, unicode):
        securityID = str(securityID)

    requestString.append("securityID=%s"%(securityID))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktTickRTSnapshotIndexGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktTickRTSnapshotIndexGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'timestamp', u'ticker', u'exchangeCD', u'localTimestamp', u'dataDate', u'dataTime', u'shortNM', u'utcOffset', u'currencyCD', u'prevClosePrice', u'openPrice', u'volume', u'value', u'deal', u'highPrice', u'lowPrice', u'lastPrice', u'bidBook_price1', u'bidBook_volume1', u'bidBook_price2', u'bidBook_volume2', u'bidBook_price3', u'bidBook_volume3', u'bidBook_price4', u'bidBook_volume4', u'bidBook_price5', u'bidBook_volume5', u'askBook_price1', u'askBook_volume1', u'askBook_price2', u'askBook_volume2', u'askBook_price3', u'askBook_volume3', u'askBook_price4', u'askBook_volume4', u'askBook_price5', u'askBook_volume5', u'suspension']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','dataDate': 'str','dataTime': 'str','shortNM': 'str','utcOffset': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutureTickRTSnapshotGet(instrumentID = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只期货的最新市场信息快照
    
    :param instrumentID: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureTickRTSnapshot.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutureTickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutureTickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'timestamp', u'dataDate', u'dataTime', u'dataMillisec', u'prevClosePrice', u'openPrice', u'volume', u'value', u'highPrice', u'lowPrice', u'lastPrice', u'exchangeCD', u'openInterest', u'preOpenInterest', u'upperLimitPrice', u'lowerLimitPrice', u'preSettlementPrice', u'settlementPrice', u'closePrice', u'preDelta', u'currDelta', u'clearingDay', u'bidBook_price1', u'bidBook_volume1', u'bidBook_price2', u'bidBook_volume2', u'bidBook_price3', u'bidBook_volume3', u'bidBook_price4', u'bidBook_volume4', u'bidBook_price5', u'bidBook_volume5', u'askBook_price1', u'askBook_volume1', u'askBook_price2', u'askBook_volume2', u'askBook_price3', u'askBook_volume3', u'askBook_price4', u'askBook_volume4', u'askBook_price5', u'askBook_volume5', u'milliSecOffset', u'localTimestamp', u'currencyCD', u'utcOffset']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataDate': 'str','dataTime': 'str','exchangeCD': 'str','clearingDay': 'str','currencyCD': 'str','utcOffset': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktTickRTIntraDayGet(securityID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只证券当日内时间段的Level1信息。 证券可以是股票，指数， 部分债券或 基金。
    
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所。
    :param startTime: 开始时间，必须大于等于09:25，例如10:05，如果为空则是09:25,可空
    :param endTime: 结束时间，必须小于等于15:05，例如14:20，如果为空则是15：05,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getTickRTIntraDay.csv?ispandas=1&') 
    if not isinstance(securityID, str) and not isinstance(securityID, unicode):
        securityID = str(securityID)

    requestString.append("securityID=%s"%(securityID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktTickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktTickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'exchangeCD', u'shortNM', u'secOffset', u'currencyCD', u'prevClosePrice', u'openPrice', u'volume', u'value', u'deal', u'highPrice', u'lowPrice', u'lastPrice', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','ticker': 'str','exchangeCD': 'str','shortNM': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktBarRTIntraDayGet(securityID, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只证券当日的分钟线信息，包含1/5/15/30/60分钟的分钟线。 输入一只证券代码，如000001.XSHE（平安银行）， 得到此证券的当日的分钟线。 证券目前是股票，指数，基金和部分债券。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param securityID: 通联编制的证券编码。格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所。
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(securityID, str) and not isinstance(securityID, unicode):
        securityID = str(securityID)

    requestString.append("securityID=%s"%(securityID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'shortNM', u'utcOffset', u'currencyCD', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str','utcOffset': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktBarHistOneDayGet(securityID, date, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只证券在历史某一日的分钟线信息，包含1/3/5/15/30/60分钟的分钟线。 输入一只证券代码，如000001.XSHE（平安银行）， 得到这只证券在历史某一日的分钟线数据。 证券目前是股票，指数，基金和部分债券。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所，XHKG-香港交易所。,可以是列表
    :param date: 查询日期，格式YYYYMMDD
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/3(分钟)/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getBarHistOneDay.csv?ispandas=1&') 
    requestString.append("securityID=")
    if hasattr(securityID,'__iter__') and not isinstance(securityID, str):
        if len(securityID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = securityID
            requestString.append(None)
        else:
            requestString.append(','.join(securityID))
    else:
        requestString.append(securityID)
    try:
        date = date.strftime('%Y%m%d')
    except:
        date = date.replace('-', '')
    requestString.append("&date=%s"%(date))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'shortNM', u'currencyCD', u'dataDate', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktBarHistDateRangeGet(securityID, startDate, endDate, unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只证券在历史某个日期段的分钟线信息，包含1/3/5/15/30/60分钟的分钟线。 输入一只证券代码，如000001.XSHE（平安银行）， 得到这只证券在历史某个日期段的分钟线数据。 证券目前是股票，指数，基金和部分债券。 不支持跨月查询：开始日期和结束日期必须在同一个月内。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所，XHKG-香港交易所。
    :param startDate: 日期范围的起始日期，格式““YYYYMMDD”。
    :param endDate: 日期范围的截止日期，格式““YYYYMMDD”。startDate和endDate必须在同一个月。
    :param unit: Bar(s)的时间宽度，单位分钟, 如 1(分钟)/3(分钟)/5(分钟)/10(分钟)/60(分钟),可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getBarHistDateRange.csv?ispandas=1&') 
    if not isinstance(securityID, str) and not isinstance(securityID, unicode):
        securityID = str(securityID)

    requestString.append("securityID=%s"%(securityID))
    if not isinstance(startDate, str) and not isinstance(startDate, unicode):
        startDate = str(startDate)

    requestString.append("&startDate=%s"%(startDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktBarHistDateRangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktBarHistDateRangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'shortNM', u'currencyCD', u'dataDate', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktTicksHistOneDayGet(securityID, date, startSecOffset = "", endSecOffset = "", field = "", pandas = "1"):
    """
    高频数据，获取一只证券在历史上某一天内的Tick数据。 输入一只证券代码，如000001.XSHE（平安银行）。证券包括股票， 指数，部分债券和基金
    
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所，XHKG-香港交易所。
    :param date: 数据日期。格式是YYYYMMDD。
    :param startSecOffset: 查询范围的开始时间相对8点的秒偏移量(>=0)。,可空
    :param endSecOffset: 查询范围的结束时间相对8点的秒偏移量(>=0)。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getTicksHistOneDay.csv?ispandas=1&') 
    if not isinstance(securityID, str) and not isinstance(securityID, unicode):
        securityID = str(securityID)

    requestString.append("securityID=%s"%(securityID))
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(startSecOffset, str) and not isinstance(startSecOffset, unicode):
        startSecOffset = str(startSecOffset)

    requestString.append("&startSecOffset=%s"%(startSecOffset))
    if not isinstance(endSecOffset, str) and not isinstance(endSecOffset, unicode):
        endSecOffset = str(endSecOffset)

    requestString.append("&endSecOffset=%s"%(endSecOffset))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'exchangeCD', u'shortNM', u'secOffset', u'currencyCD', u'prevClosePrice', u'openPrice', u'volume', u'value', u'deal', u'highPrice', u'lowPrice', u'lastPrice', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','ticker': 'str','exchangeCD': 'str','shortNM': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktTicksHistTimeSeriesGet(securityID, date, startOffset, endOffset, field = "", pandas = "1"):
    """
    高频数据，获取一只或多只证券在历史上某一个交易日内某个时间段的Tick数据。 输入一只证券代码，如000001.XSHE（平安银行）。证券包括股票， 指数，部分债券和基金,按照时间排序。
    
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 证券市场代码请根据证券的上市市场确定：XSHG-上海证券交易所，XSHE-深圳证券交易所，XHKG-香港交易所。,可以是列表
    :param date: 历史交易日期。格式是YYYYMMDD，如20140106表示2014年1月6日。
    :param startOffset: 开始时间偏移，相对于早上八点的秒数偏移，如5400
    :param endOffset: 结束时间偏移，相对于早上八点的秒数偏移，如6000，注意endOffset-startOffset最多为600(10分钟)，此外，注意最后返回的数据的时间区间是[startOffset, endOffset)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getTicksHistTimeSeries.csv?ispandas=1&') 
    requestString.append("securityID=")
    if hasattr(securityID,'__iter__') and not isinstance(securityID, str):
        if len(securityID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = securityID
            requestString.append(None)
        else:
            requestString.append(','.join(securityID))
    else:
        requestString.append(securityID)
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(startOffset, str) and not isinstance(startOffset, unicode):
        startOffset = str(startOffset)

    requestString.append("&startOffset=%s"%(startOffset))
    if not isinstance(endOffset, str) and not isinstance(endOffset, unicode):
        endOffset = str(endOffset)

    requestString.append("&endOffset=%s"%(endOffset))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktTicksHistTimeSeriesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktTicksHistTimeSeriesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'exchangeCD', u'shortNM', u'secOffset', u'currencyCD', u'prevClosePrice', u'openPrice', u'volume', u'value', u'deal', u'highPrice', u'lowPrice', u'lastPrice', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','ticker': 'str','exchangeCD': 'str','shortNM': 'str','currencyCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutureTicksHistOneDayGet(instrumentID, date, startSecOffset = "", endSecOffset = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期货在历史上某一清算日内的Tick数据，可根据交易时间筛选返回数据。
    
    :param instrumentID: 一个期货合约代码，如A1009;也可以是期货合约类型，如A，此时表示查主力合约。郑商所代码前加“1”统一成标准4位，无实际意义。API调取历史高频数据时，输入三位（如：rm001）或四位（如：rm1001）的代码都可查询，返回数据为标准4位（如：rm1001）。
    :param date: 数据清算日期。格式是“YYYYMMDD”，一个完整的清算日包含夜盘+日盘的全部Tick信息
    :param startSecOffset: 开始时间相对0点的秒偏移量。若从09:00开始，则填写32400。,可空
    :param endSecOffset: 结束时间相对0点的秒偏移量，若到10:00结束，则填写36000。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureTicksHistOneDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(startSecOffset, str) and not isinstance(startSecOffset, unicode):
        startSecOffset = str(startSecOffset)

    requestString.append("&startSecOffset=%s"%(startSecOffset))
    if not isinstance(endSecOffset, str) and not isinstance(endSecOffset, unicode):
        endSecOffset = str(endSecOffset)

    requestString.append("&endSecOffset=%s"%(endSecOffset))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutureTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutureTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataMillisec', u'dataTime', u'instrumentID', u'dataDate', u'askPrice1', u'askPrice2', u'askPrice3', u'askPrice4', u'askPrice5', u'askVolume1', u'askVolume2', u'askVolume3', u'askVolume4', u'askVolume5', u'bidPrice1', u'bidPrice2', u'bidPrice3', u'bidPrice4', u'bidPrice5', u'bidVolume1', u'bidVolume2', u'bidVolume3', u'bidVolume4', u'bidVolume5', u'clearingDay', u'closePrice', u'contractType', u'currDelta', u'exchangeCD', u'highPrice', u'lastPrice', u'lowerLimitPrice', u'lowPrice', u'mflag', u'openInterest', u'openPrice', u'preDelta', u'preOpenInterest', u'preSettlementPrice', u'prevClosePrice', u'settlementPrice', u'source', u'tflag', u'upperLimitPrice', u'value', u'volume', u'milliSecOffset']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','instrumentID': 'str','clearingDay': 'str','contractType': 'str','exchangeCD': 'str','mflag': 'str','source': 'str','tflag': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutureTicksHistTimeSeriesGet(instrumentID, date, startSecOffset, endSecOffset, field = "", pandas = "1"):
    """
    高频数据，获取多只期货在历史上某一天某个时间段内的Tick数据，最多10分钟
    
    :param instrumentID: 多只期货代码，用逗号分割，每个代码可以是期货合约代码，也可以是期货品种，表示查询主力合约，如A1009，C"表示查询A1009和C品种的主力合约,可以是列表
    :param date: 日期，格式如20130719，这里表示的是交易日
    :param startSecOffset: 开始时间，是相对0点的秒偏移量
    :param endSecOffset: 结束时间，是相对0点的秒偏移量，0< endSecOffset-startSecOffset<=600，返回的数据区间是[startSecOffset, endSecOffset)
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureTicksHistTimeSeries.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(startSecOffset, str) and not isinstance(startSecOffset, unicode):
        startSecOffset = str(startSecOffset)

    requestString.append("&startSecOffset=%s"%(startSecOffset))
    if not isinstance(endSecOffset, str) and not isinstance(endSecOffset, unicode):
        endSecOffset = str(endSecOffset)

    requestString.append("&endSecOffset=%s"%(endSecOffset))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutureTicksHistTimeSeriesGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutureTicksHistTimeSeriesGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'dataMillisec', u'instrumentID', u'exchangeCD', u'lastPrice', u'lowPrice', u'highPrice', u'volume', u'value', u'openInterest', u'preOpenInterest', u'upperLimitPrice', u'lowerLimitPrice', u'preSettlementPrice', u'prevClosePrice', u'settlementPrice', u'openPrice', u'closePrice', u'preDelta', u'currDelta', u'clearingDay', u'mflag', u'tflag', u'source', u'contractType', u'milliSecOffset', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','instrumentID': 'str','exchangeCD': 'str','clearingDay': 'str','mflag': 'str','tflag': 'str','source': 'str','contractType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutureTicksHistOneClearingDayGet(instrumentID, date, tflag, field = "", pandas = "1"):
    """
    高频数据，获取一只期货在历史上某一清算日的Tick数据
    
    :param instrumentID: 一个期货合约代码，如A1009(大小写均可);也可以是期货品种代码，如A，此时表示查主力合约。
    :param date: 日期，格式如20130719，注意这里表示的是清算日
    :param tflag: 查询日盘，夜盘，还是全部，1表示日盘，0表示夜盘，2表示全部
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureTicksHistOneClearingDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(tflag, str) and not isinstance(tflag, unicode):
        tflag = str(tflag)

    requestString.append("&tflag=%s"%(tflag))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutureTicksHistOneClearingDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutureTicksHistOneClearingDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataMillisec', u'instrumentID', u'dataTime', u'askPrice1', u'askPrice2', u'askPrice3', u'askPrice4', u'askPrice5', u'askVolume1', u'askVolume2', u'askVolume3', u'askVolume4', u'askVolume5', u'bidPrice1', u'bidPrice2', u'bidPrice3', u'bidPrice4', u'bidPrice5', u'bidVolume1', u'bidVolume2', u'bidVolume3', u'bidVolume4', u'bidVolume5', u'clearingDay', u'closePrice', u'contractType', u'currDelta', u'exchangeCD', u'highPrice', u'lastPrice', u'lowerLimitPrice', u'lowPrice', u'mflag', u'openInterest', u'openPrice', u'preDelta', u'preOpenInterest', u'preSettlementPrice', u'prevClosePrice', u'settlementPrice', u'source', u'tflag', u'upperLimitPrice', u'value', u'volume', u'milliSecOffset']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','dataTime': 'str','contractType': 'str','exchangeCD': 'str','mflag': 'str','source': 'str','tflag': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutureTickRTIntraDayGet(instrumentID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期货在本清算日内某时间段的Tick数据
    
    :param instrumentID: 一个期货合约代码，如A1009(大小写均可)，此处不可以是合约类型代码。
    :param startTime: 开始时间，如10:10，若想返回夜盘数据，需startTime输入00:00，endTime输入24:00，返回夜盘至查询时刻的全部数据,可空
    :param endTime: 结束时间，如10:15,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureTickRTIntraDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutureTickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutureTickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'dataMillisec', u'instrumentID', u'exchangeCD', u'lastPrice', u'lowPrice', u'highPrice', u'volume', u'value', u'openInterest', u'preOpenInterest', u'upperLimitPrice', u'lowerLimitPrice', u'preSettlementPrice', u'prevClosePrice', u'settlementPrice', u'openPrice', u'closePrice', u'preDelta', u'currDelta', u'clearingDay', u'milliSecOffset', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','instrumentID': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutureBarRTIntraDayGet(instrumentID, startTime = "", endTime = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取当日期货分钟线，包含1/5/15/30/60分钟的分钟线。分钟线的有效数据从夜盘开始到日线结束，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，第一根分钟线包含时间范围为集合竞价开始到连续竞价开始
    
    :param instrumentID: 期货在证券市场通用的交易代码。
    :param startTime: 根据bar的时间范围查询的开始时间，默认是前一天的20:00（前一天夜盘开始时间）。格式"hh:mm"。,可空
    :param endTime: 根据bar的时间范围查询的结束时间，默认是当前时间。格式"hh:mm"。,可空
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutureBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutureBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'instrumentID', u'exchangeCD', u'utcOffset', u'currencyCD', u'barTime', u'totalVolume', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','exchangeCD': 'str','utcOffset': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutureBarHistOneDayGet(instrumentID, date, unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或者多只期货在历史某一清算日的分钟线数据，包含1/3/5/15/30/60分钟的分钟线。分钟线的有效数据从夜盘开始到日线结束，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，第一根分钟线包含时间范围为集合竞价开始到连续竞价开始
    
    :param instrumentID: 期货代码，支持多值输入,可以是列表
    :param date: 查询日期，以清算日为准，例如20140210，会返回20140209的夜盘和20140210的日盘
    :param unit: Bar(s)的时间宽度，单位分钟，如 1（分钟）/3(分钟)/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureBarHistOneDay.csv?ispandas=1&') 
    requestString.append("instrumentID=")
    if hasattr(instrumentID,'__iter__') and not isinstance(instrumentID, str):
        if len(instrumentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = instrumentID
            requestString.append(None)
        else:
            requestString.append(','.join(instrumentID))
    else:
        requestString.append(instrumentID)
    if not isinstance(date, str) and not isinstance(date, unicode):
        date = str(date)

    requestString.append("&date=%s"%(date))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutureBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutureBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'barTime', u'dataDate', u'clearingDay', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'unit', u'totalValue', u'currencyCD', u'openInterest', u'exchangeCD']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','barTime': 'str','currencyCD': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def MktFutureBarHistDateRangeGet(instrumentID, startDate, endDate, unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期货在历史某个日期段内的分钟线数据，包含1/3/5/15/30/60分钟的分钟线。不支持跨月查询：开始日期和结束日期必须在同一个月内。分钟线的有效数据从夜盘开始到日线结束，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，第一根分钟线包含时间范围为集合竞价开始到连续竞价开始
    
    :param instrumentID: 期货代码，仅支持单值输入
    :param startDate: 起始日期，需与结束日期在同一个月
    :param endDate: 结束日期，需与起始日期在同一个月
    :param unit: Bar(s)的时间宽度，单位分钟，如 1（分钟）/3(分钟)/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureBarHistDateRange.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startDate, str) and not isinstance(startDate, unicode):
        startDate = str(startDate)

    requestString.append("&startDate=%s"%(startDate))
    if not isinstance(endDate, str) and not isinstance(endDate, unicode):
        endDate = str(endDate)

    requestString.append("&endDate=%s"%(endDate))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'MktFutureBarHistDateRangeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'MktFutureBarHistDateRangeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'instrumentID', u'unit', u'exchangeCD', u'currencyCD', u'clearingDay', u'dataDate', u'barTime', u'closePrice', u'highPrice', u'lowPrice', u'openInterest', u'openPrice', u'totalValue', u'totalVolume']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','exchangeCD': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BarRTIntraDayOneMinuteGet(time, unit = "", exchangeCD = "", assetClass = "", field = "", pandas = "1"):
    """
    高频数据，获取当日所有股票某一分钟的分钟线，包含1/5/15/30/60分钟的分钟线。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param time: 查询时间，如09:33
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可空
    :param assetClass: 通联编制的证券类别编码。例如，E-股票；B-债券；F-基金；FU-期货等。对应DataAPI.SysCodeGet.codeTypeID=10001。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getBarRTIntraDayOneMinute.csv?ispandas=1&') 
    if not isinstance(time, str) and not isinstance(time, unicode):
        time = str(time)

    requestString.append("time=%s"%(time))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BarRTIntraDayOneMinuteGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BarRTIntraDayOneMinuteGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'shortNM', u'utcOffset', u'currencyCD', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str','utcOffset': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def EquRTRankGet(exchangeCD = "", desc = "", field = "", pandas = "1"):
    """
    获取沪深股票涨跌幅排行
    
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可空
    :param desc: 是否是跌幅排行；不输入返回涨幅排行；输入1返回跌幅排行,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getEquRTRank.csv?ispandas=1&') 
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("exchangeCD=%s"%(exchangeCD))
    if not isinstance(desc, str) and not isinstance(desc, unicode):
        desc = str(desc)

    requestString.append("&desc=%s"%(desc))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'EquRTRankGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'EquRTRankGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataTime', u'ticker', u'exchangeCD', u'shortNM', u'prevClosePrice', u'openPrice', u'volume', u'value', u'deal', u'highPrice', u'lowPrice', u'lastPrice', u'change', u'changePct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','ticker': 'str','exchangeCD': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IndustryTickRTSnapshotGet(securityID = "", field = "", pandas = "1"):
    """
    获取行业（证监会行业标准）资金流向，内容包括小单，中单，大单，超大单的资金流入，流出，净流入等。
    
    :param securityID: 证监会行业分类标准的二级行业ID，用“,”分隔，为空返回所有行业，可以使用getIndustry接口获取所有ID，industryVersionCD=010301，industryLevel=2。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getIndustryTickRTSnapshot.csv?ispandas=1&') 
    requestString.append("securityID=")
    if hasattr(securityID,'__iter__') and not isinstance(securityID, str):
        if len(securityID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = securityID
            requestString.append(None)
        else:
            requestString.append(','.join(securityID))
    else:
        requestString.append(securityID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IndustryTickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IndustryTickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'type', u'inflowL', u'dataDate', u'inflowM', u'dataTime', u'inflowS', u'shortNM', u'inflowXL', u'netInflowL', u'netInflowM', u'netInflowS', u'netInflowXL', u'outflowL', u'outflowM', u'outflowS', u'outflowXL']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'type': 'str','dataDate': 'str','dataTime': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def TickRTIntraDayMoneyFlowOrderGet(securityID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取一只股票当日资金流向
    
    :param securityID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。
    :param startTime: 开始时间，必须大于等于09:25，例如10:05，如果为空则是09:25,可空
    :param endTime: 结束时间，必须小于等于15:05，例如14:20，如果为空则是15：05,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getTickRTIntraDayMoneyFlowOrder.csv?ispandas=1&') 
    if not isinstance(securityID, str) and not isinstance(securityID, unicode):
        securityID = str(securityID)

    requestString.append("securityID=%s"%(securityID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'TickRTIntraDayMoneyFlowOrderGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'TickRTIntraDayMoneyFlowOrderGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'exchangeCD', u'secOffset', u'moneyInflow', u'moneyInflowType', u'moneyOutflow', u'moneyOutflowType', u'netMoneyInflow', u'netMoneyInflowType']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','ticker': 'str','exchangeCD': 'str','moneyInflowType': 'str','moneyOutflowType': 'str','netMoneyInflowType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def VirtualAuctionIntraDayGet(secID, field = "", pandas = "1"):
    """
    高频数据，获取一只证券当日集合竞价信息，证券类型可以是股票，部分债券或基金，时间范围为9:15:00~9:25:00。
    
    :param secID: 通联编制的证券编码，格式是“交易代码.证券市场代码”，如000001.XSHE。 可传入证券交易代码使用DataAPI.SecIDGet接口获取到。,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getVirtualAuctionIntraDay.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'VirtualAuctionIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'VirtualAuctionIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'tradeDate', u'tradeTime', u'virAucPrice', u'virAucQty', u'leaveQty', u'side']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','tradeTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SHSZTickRTIntraDayGet(ticker, exchangeCD, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只沪深证券在当日时间段内的tick数据，包含最新价、最高价、最低价、成交量、成交金额，买卖五档信息等
    
    :param ticker: 证券在交易所的交易代码，比如000001-平安银行
    :param exchangeCD: XSHE-深交所；XSHG-上交所
    :param startTime: 开始时间，格式为HH:MM,可空
    :param endTime: 结束时间，格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZTickRTIntraDay.csv?ispandas=1&') 
    if not isinstance(ticker, str) and not isinstance(ticker, unicode):
        ticker = str(ticker)

    requestString.append("ticker=%s"%(ticker))
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SHSZTickRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SHSZTickRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'ticker', u'secOffset', u'dataTime', u'exchangeCD', u'currencyCD', u'shortNM', u'prevClosePrice', u'openPrice', u'volume', u'value', u'highPrice', u'lowPrice', u'lastPrice', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','ticker': 'str','dataTime': 'str','exchangeCD': 'str','currencyCD': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutureSecBarHistOneDayGet(instrumentID, tradeDate, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期货合约在历史某一清算日（包含夜盘）内自交易开始的所有秒线行情信息
    
    :param instrumentID: 期货代码，如"bu1709"
    :param tradeDate: 清算日期，包含夜盘数据，如"YYYYMMDD"
    :param startTime: 秒线起始时间，不输入默认返回当前交易日开始时间，可输入"HHMM"或"HHMMSS"的形式,可空
    :param endTime: 秒线截止时间，不输入默认返回当前交易日结束时间，可输入"HHMM"或"HHMMSS"的形式,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureSecBarHistOneDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutureSecBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutureSecBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'clearingDay', u'tDate', u'instrumentID', u'exchangeCD', u'barTime', u'totalVolume', u'totalValue', u'highPrice', u'lowPrice', u'openPrice', u'closePrice', u'openInterest', u'bidBook_price1', u'bidBook_volume1', u'askBook_price1', u'askBook_volume1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'instrumentID': 'str','exchangeCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutureSecBarRTIntraDayGet(instrumentID, startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只期货合约在当日（包含夜盘）内一段时间秒线行情信息
    
    :param instrumentID: 期货代码，如"bu1709"
    :param startTime: 秒线起始时间，不输入默认返回当前交易日开始时间，可输入"HHMM"或"HHMMSS"的形式,可空
    :param endTime: 秒线截止时间，不输入默认返回当前交易日结束时间，可输入"HHMM"或"HHMMSS"的形式,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getFutureSecBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(instrumentID, str) and not isinstance(instrumentID, unicode):
        instrumentID = str(instrumentID)

    requestString.append("instrumentID=%s"%(instrumentID))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutureSecBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutureSecBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tDate', u'clearingDay', u'barTime', u'exchangeCD', u'instrumentID', u'openPrice', u'highPrice', u'lowPrice', u'closePrice', u'totalVolume', u'totalValue', u'openInterest', u'bidBook_price1', u'bidBook_volume1', u'askBook_price1', u'askBook_volume1']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','instrumentID': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SHSZMoneyFlowBarHistOneDayGet(ticker, tradeDate, beginTime = "", endTime = "", investorType = "", unit = "", field = "", pandas = "1"):
    """
    高频数据，获取一只沪深股票在历史某一交易日的资金流向分钟粒度数据，包含主力、散户和原始资金流向等分类，其中主力定义为瞬时成交额为500w（包含）或以上的记录，散户为瞬时成交额为500w以下及记录。分钟划分标准为分钟前开后闭，向后归结，即（9:30:00,9:31:00]算作9:31的分钟线。主力、散户不计算集合竞价期间成交信息
    
    :param ticker: 证券在交易所的交易代码，如000001，最多输入5个股票,可以是列表
    :param tradeDate: 交易日期，格式为YYYYMMDD
    :param beginTime: 分钟线开始时间，格式为HH:MM,不输入默认09:30,可空
    :param endTime: 分钟线开始时间，格式为HH:MM,不输入默认15:00,可空
    :param investorType: 0-原始数据；1-主力；2-散户，不输入默认为原始数据,可空
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZMoneyFlowBarHistOneDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    if not isinstance(investorType, str) and not isinstance(investorType, unicode):
        investorType = str(investorType)

    requestString.append("&investorType=%s"%(investorType))
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SHSZMoneyFlowBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SHSZMoneyFlowBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'tradeDate', u'barTime', u'exchangeCD', u'investorType', u'moneyInflowS', u'moneyInflowM', u'moneyInflowL', u'moneyInflowXL', u'moneyOutflowS', u'moneyOutflowM', u'moneyOutflowL', u'moneyOutflowXL', u'moneyNetInflowS', u'moneyNetInflowM', u'moneyNetInflowL', u'moneyNetInflowXL']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'barTime': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SHSZTicksHistOneDayGet(ticker, exchangeCD, tradeDate, field = "", pandas = "1"):
    """
    高频数据，获取一只沪深证券在历史上某一天内的Tick数据。 输入一只证券代码，如000001和证券所在的交易市场XSHE，即可获取平安银行的历史行情。证券包括股票， 指数，部分债券和基金
    
    :param ticker: 证券在证券市场通用的交易代码,可以是列表
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。
    :param tradeDate: 格式是YYYYMMDD,可以是列表
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZTicksHistOneDay.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&tradeDate=")
    if hasattr(tradeDate,'__iter__') and not isinstance(tradeDate, str):
        if len(tradeDate) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDate
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDate))
    else:
        requestString.append(tradeDate)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SHSZTicksHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SHSZTicksHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'tradeDate', u'ticker', u'dataTime', u'exchangeCD', u'currencyCD', u'shortNM', u'prevClosePrice', u'openPrice', u'volume', u'value', u'deal', u'highPrice', u'lowPrice', u'lastPrice', u'bidPrice1', u'bidVolume1', u'bidPrice2', u'bidVolume2', u'bidPrice3', u'bidVolume3', u'bidPrice4', u'bidVolume4', u'bidPrice5', u'bidVolume5', u'askPrice1', u'askVolume1', u'askPrice2', u'askVolume2', u'askPrice3', u'askVolume3', u'askPrice4', u'askVolume4', u'askPrice5', u'askVolume5']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','exchangeCD': 'str','currencyCD': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SHSZBarRTIntraDayGet(unit, startTime = "", endTime = "", ticker = "", exchangeCD = "", assetClass = "", field = "", pandas = "1"):
    """
    高频数据，获取一只沪深交易所证券当日的分钟线信息，包含1/3/5/15/30/60分钟的分钟线。 证券目前是股票，指数，基金和部分债券。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/ 3（分钟）/5（分钟）/15（分钟）/30（分钟）/60（分钟）
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表,可空
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所等。对应DataAPI.SysCodeGet.codeTypeID=10002。不填默认为深交所。,可空
    :param assetClass: 证券类型。例如，E-股票,B-债券,F-基金。对应DataAPI.SysCodeGet.codeTypeID=10001。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZBarRTIntraDay.csv?ispandas=1&') 
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("unit=%s"%(unit))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SHSZBarRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SHSZBarRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'unit', u'ticker', u'exchangeCD', u'shortNM', u'currencyCD', u'barTime', u'closePrice', u'openPrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','exchangeCD': 'str','shortNM': 'str','currencyCD': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SHSZBarHistOneDayGet(tradeDate, exchangeCD, ticker, unit = "", startTime = "", endTime = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只沪深证券在历史某一日的分钟线信息，包含1/3/5/15/30/60分钟的分钟线。 输入一只证券代码，如000001（平安银行）， 得到这只证券在历史某一日的分钟线数据。 证券目前是股票，指数，基金和部分债券。分钟线的有效数据上午从09：30 到11：30，下午从13：01到15：00，分钟线的计算规则为分钟内前开后闭，向后归结，即（9:31:00.000，9:32:00.000]归为9:32分的数据，9:30的分钟线包含时间范围为9:30:00前所有成交（即集合竞价成交）
    
    :param tradeDate: 查询日期，格式YYYYMMDD
    :param exchangeCD: 通联编制的证券市场编码。例如，XIBE-中国银行间市场；XSHE-深圳证券交易所等。对应DataAPI.SysCodeGet.codeTypeID=10002。
    :param ticker: 证券在证券市场通用的交易代码。,可以是列表
    :param unit: Bar(s)的时间宽度，单位分钟。取值范围： 1（分钟）/3(分钟)/5（分钟）/15（分钟）/30（分钟）/60（分钟）,可空
    :param startTime: 分钟线起始时间， 如09:40，就是从早上九点四十开始。 默认开始时间早上开市时间，即09:30，不选即为默认值,可空
    :param endTime: 分钟线终止时间， 如14:00, 就是到下午14点结束。 如终止时间是空， 则截止到最新数据或到关市为止，即15:00，不选即为默认值,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZBarHistOneDay.csv?ispandas=1&') 
    if not isinstance(tradeDate, str) and not isinstance(tradeDate, unicode):
        tradeDate = str(tradeDate)

    requestString.append("tradeDate=%s"%(tradeDate))
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(unit, str) and not isinstance(unit, unicode):
        unit = str(unit)

    requestString.append("&unit=%s"%(unit))
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SHSZBarHistOneDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SHSZBarHistOneDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'currencyCD', u'unit', u'ticker', u'barTime', u'closePrice', u'dataDate', u'highPrice', u'lowPrice', u'openPrice', u'shortNM', u'totalValue', u'totalVolume', u'vwap']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','currencyCD': 'str','ticker': 'str','barTime': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SHSZTickRTSnapshotGet(exchangeCD, assetClass = "", ticker = "", field = "", pandas = "1"):
    """
    高频数据，获取一只或多只证券最新Level1信息快照。 输入一只或多只证券交易代码，如000001,并指定其证券品种,如"E",即可获取平安银行的最新市场信息快照, 证券可以是股票，指数， 部分债券或 基金，默认返回股票，若要返回指数，需指定assetClass为IDX。
    
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表
    :param assetClass: 通联编制的证券类别编码。例如，E-股票；B-债券；F-基金；IDX-指数等;对应DataAPI.SysCodeGet.codeTypeID=10001;不输入返回股票。,可空
    :param ticker: 证券在证券市场通用的交易代码,不输入返回全市场证券,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZTickRTSnapshot.csv?ispandas=1&') 
    requestString.append("exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    if not isinstance(assetClass, str) and not isinstance(assetClass, unicode):
        assetClass = str(assetClass)

    requestString.append("&assetClass=%s"%(assetClass))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SHSZTickRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SHSZTickRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'shortNM', u'exchangeCD', u'currencyCD', u'prevClosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'volume', u'value', u'deal', u'negMarketValue', u'MarketValue', u'staticPE', u'forwardPE', u'PETTM', u'PB', u'PCFTTM', u'PSTTM', u'amplitude', u'change', u'changePct', u'turnoverRate', u'askBook', u'bidBook', u'suspension', u'timestamp', u'VR', u'DR']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','ticker': 'str','shortNM': 'str','exchangeCD': 'str','currencyCD': 'str','askBook': 'str','bidBook': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def BarRTSnapshotGet(exchangeCD, ticker = "", assetClass = "", field = "", pandas = "1"):
    """
    获取一只或多只证券最新快照信息，输入证券代码和交易所，返回该证券最近一根分钟线，支持股票、基金、债券、指数、期货、期权
    
    :param exchangeCD: 通联编制的证券市场编码。例如，XIBE-中国银行间市场；XSHE-深圳证券交易所等。对应DataAPI.SysCodeGet.codeTypeID=10002。
    :param ticker: 证券在交易所的交易代码,可以是列表,可空
    :param assetClass: 证券类型。例如，E-股票,B-债券,F-基金,FU-期货,OP-期权。对应DataAPI.SysCodeGet.codeTypeID=10001。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getBarRTSnapshot.csv?ispandas=1&') 
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("exchangeCD=%s"%(exchangeCD))
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&assetClass=")
    if hasattr(assetClass,'__iter__') and not isinstance(assetClass, str):
        if len(assetClass) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = assetClass
            requestString.append(None)
        else:
            requestString.append(','.join(assetClass))
    else:
        requestString.append(assetClass)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'BarRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'BarRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ticker', u'barTime', u'openPrice', u'closePrice', u'highPrice', u'lowPrice', u'totalVolume', u'totalValue', u'openInterest']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ticker': 'str','barTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ThemeRTSnapshotGet(themeID = "", themeName = "", field = "", pandas = "1"):
    """
    获取主题概念板块最新的市场信息快照，包括开盘价、最高价、最低价、最新价、成交量、成交金额、涨家数、跌家数等信息
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表,themeID、themeName至少选择一个
    :param themeName: 主题名称，可根据getTkgThemes获取，支持模糊查询,可以是列表,themeID、themeName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getThemeRTSnapshot.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    requestString.append("&themeName=")
    if hasattr(themeName,'__iter__') and not isinstance(themeName, str):
        if len(themeName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeName
            requestString.append(None)
        else:
            requestString.append(','.join(themeName))
    else:
        requestString.append(themeName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ThemeRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ThemeRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'dataDate', u'dataTime', u'preclosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'volume', u'value', u'turnoverRate', u'chgPct', u'ticker', u'upCount', u'downCount', u'upLimitCount', u'downLimitCount', u'netInflow', u'netMainInflow', u'chgPct5', u'chgPct10', u'chgPct20', u'chgPctFY']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str','dataTime': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def ThemeRTIntraDayGet(themeID = "", themeName = "", beginTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取主题概念板块在当日内的Tick数据，包括开盘价、最高价、最低价、最新价、成交量、成交金额、涨家数、跌家数等信息
    
    :param themeID: 主题ID，可根据getTkgThemes获取,可以是列表,themeID、themeName至少选择一个
    :param themeName: 主题名称，可根据getTkgThemes获取，支持模糊查询,可以是列表,themeID、themeName至少选择一个
    :param beginTime: 查询起始时间，格式为hh:mm:ss,可空
    :param endTime: 查询截止时间，格式为hh:mm:ss,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getThemeRTIntraDay.csv?ispandas=1&') 
    requestString.append("themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    requestString.append("&themeName=")
    if hasattr(themeName,'__iter__') and not isinstance(themeName, str):
        if len(themeName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeName
            requestString.append(None)
        else:
            requestString.append(','.join(themeName))
    else:
        requestString.append(themeName)
    if not isinstance(beginTime, str) and not isinstance(beginTime, unicode):
        beginTime = str(beginTime)

    requestString.append("&beginTime=%s"%(beginTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'ThemeRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'ThemeRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'themeID', u'themeName', u'dataDate', u'dataTime', u'preclosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'volume', u'value', u'turnoverRate', u'chgPct', u'ticker', u'upCount', u'downCount', u'upLimitCount', u'downLimitCount', u'netInflow', u'netMainInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'themeName': 'str','dataTime': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HEYENetMoneyInflowGet(ticker = "", themeID = "", typeSymbol = "", field = "", pandas = "1"):
    """
    获取多个个股或者多个主题，或多个行业板块的资金净流入快照信息
    
    :param ticker: 输入股票交易代码，如000001,可以是列表,ticker、themeID、typeSymbol至少选择一个
    :param themeID: 通联编制的主题代码，可根据getTkgThemes获取,可以是列表,ticker、themeID、typeSymbol至少选择一个
    :param typeSymbol: 行业代码，申万行业代码,可以是列表,ticker、themeID、typeSymbol至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHEYENetMoneyInflow.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&themeID=")
    if hasattr(themeID,'__iter__') and not isinstance(themeID, str):
        if len(themeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = themeID
            requestString.append(None)
        else:
            requestString.append(','.join(themeID))
    else:
        requestString.append(themeID)
    requestString.append("&typeSymbol=")
    if hasattr(typeSymbol,'__iter__') and not isinstance(typeSymbol, str):
        if len(typeSymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = typeSymbol
            requestString.append(None)
        else:
            requestString.append(','.join(typeSymbol))
    else:
        requestString.append(typeSymbol)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HEYENetMoneyInflowGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HEYENetMoneyInflowGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'ID', u'dataDate', u'dataTime', u'netMainInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'ID': 'str','dataTime': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HEYEMktIndiGet(field = "", pandas = "1"):
    """
    获取大盘指标信息，包含当前涨停股票数、跌停股票数、封板成功率、昨涨停今连板率等信息
    
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHEYEMktIndi.csv?ispandas=1&') 
    requestString.append("field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HEYEMktIndiGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HEYEMktIndiGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'upLimitNum', u'prevUpLimitNum', u'upLimitRatio', u'upLimitSide', u'downLimitNum', u'prevDownLimitNum', u'downLimitRatio', u'downLimitSide', u'limitSuccessRatio', u'prevLimitConRatio', u'limitFailRatio', u'turnoverSHSZ', u'turnoverSZ', u'turnoverSH', u'turnoverChg', u'volLabel', u'upNum', u'downNum', u'equalNum']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','upLimitSide': 'str','downLimitSide': 'str','volLabel': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IndustryPriceRTSnapshotGet(industryID = "", industryName = "", field = "", pandas = "1"):
    """
    获取行业板块最新市场信息快照，包含申万一二三级行业，涵盖开、高、低、最新价、领涨股等信息
    
    :param industryID: 行业ID，申万行业代码，可在getIndustry获取,可以是列表,industryID、industryName至少选择一个
    :param industryName: 行业中文名称,可以是列表,industryID、industryName至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getIndustryPriceRTSnapshot.csv?ispandas=1&') 
    requestString.append("industryID=")
    if hasattr(industryID,'__iter__') and not isinstance(industryID, str):
        if len(industryID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryID
            requestString.append(None)
        else:
            requestString.append(','.join(industryID))
    else:
        requestString.append(industryID)
    requestString.append("&industryName=")
    if hasattr(industryName,'__iter__') and not isinstance(industryName, str):
        if len(industryName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industryName
            requestString.append(None)
        else:
            requestString.append(','.join(industryName))
    else:
        requestString.append(industryName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IndustryPriceRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IndustryPriceRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'industryID', u'industryName', u'preclosePrice', u'openPrice', u'highPrice', u'lowPrice', u'lastPrice', u'volume', u'value', u'chgPct', u'ticker', u'upNum', u'downNum', u'equalNum', u'upLimitCount', u'downLimitCount', u'turnoverRate', u'netInflow', u'netMainInflow']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataTime': 'str','industryName': 'str','ticker': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SHSZRTIntraDayMoneyFlowOrderGet(ticker, exchangeCD, startSecOffset = "", endSecOffset = "", field = "", pandas = "1"):
    """
    获取一只或多只沪深股票当日资金流向，包含大中小单的分类信息以及资金流向金额
    
    :param ticker: 证券交易代码,可以是列表
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。
    :param startSecOffset: 查询起始秒偏移量，相对8点的秒数，如9:00为3600,可空
    :param endSecOffset: 查询结束秒偏移量，相对8点的秒数，如9:00为3600,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZRTIntraDayMoneyFlowOrder.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    if not isinstance(startSecOffset, str) and not isinstance(startSecOffset, unicode):
        startSecOffset = str(startSecOffset)

    requestString.append("&startSecOffset=%s"%(startSecOffset))
    if not isinstance(endSecOffset, str) and not isinstance(endSecOffset, unicode):
        endSecOffset = str(endSecOffset)

    requestString.append("&endSecOffset=%s"%(endSecOffset))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SHSZRTIntraDayMoneyFlowOrderGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SHSZRTIntraDayMoneyFlowOrderGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'exchangeCD', u'ticker', u'moneyInflow', u'moneyInflowType', u'moneyOutflow', u'moneyOutflowType', u'netMoneyInflow', u'netMoneyInflowType', u'secOffset']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','exchangeCD': 'str','ticker': 'str','moneyInflowType': 'str','moneyOutflowType': 'str','netMoneyInflowType': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def SHSZTickRTMoneyFlowGet(ticker = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取沪深股票累计资金流向快照，包括区分大中小单资金流入、流出、净流入与占比情况
    
    :param ticker: 证券在证券市场通用的交易代码,不输入返回全市场证券,可以是列表,ticker、exchangeCD至少选择一个
    :param exchangeCD: 交易市场,ticker、exchangeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getSHSZTickRTMoneyFlow.csv?ispandas=1&') 
    requestString.append("ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'SHSZTickRTMoneyFlowGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'SHSZTickRTMoneyFlowGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'ticker', u'exchangeCD', u'inflowS', u'inflowM', u'inflowL', u'inflowXL', u'outflowS', u'outflowM', u'outflowL', u'outflowXL', u'netflowS', u'netflowSpct', u'netflowM', u'netflowMpct', u'netflowL', u'netflowLpct', u'netflowXL', u'netflowXLpct', u'netflowT', u'netflowTpct', u'netflowNS', u'netflowNSpct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','ticker': 'str','exchangeCD': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def IndustryFlowRTSnapshotGet(industrySymbol = "", field = "", pandas = "1"):
    """
    获取行业（申万行业标准）累计资金流向，内容包括一二三级行业小单，中单，大单，超大单的资金流入，流出，净流入与占比。
    
    :param industrySymbol: 申万行业分类代码，用“,”分隔，为空返回所有行业，代码可以使用getIndustry接口获取，industryVersionCD=010303。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getIndustryFlowRTSnapshot.csv?ispandas=1&') 
    requestString.append("industrySymbol=")
    if hasattr(industrySymbol,'__iter__') and not isinstance(industrySymbol, str):
        if len(industrySymbol) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = industrySymbol
            requestString.append(None)
        else:
            requestString.append(','.join(industrySymbol))
    else:
        requestString.append(industrySymbol)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'IndustryFlowRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'IndustryFlowRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'industrySymbol', u'industryName', u'inflowS', u'inflowM', u'inflowL', u'inflowXL', u'outflowS', u'outflowM', u'outflowL', u'outflowXL', u'netflowS', u'netflowSpct', u'netflowM', u'netflowMpct', u'netflowL', u'netflowLpct', u'netflowXL', u'netflowXLpct', u'netflowT', u'netflowTpct', u'netflowNS', u'netflowNSpct']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','industrySymbol': 'str','industryName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKMktTuoRTSnapshotGet(connectMarket = "", tradeDirection = "", field = "", pandas = "1"):
    """
    获取港股通南北向资金流向最新快照
    
    :param connectMarket: 交易关联市场，SH-上交所，SZ-深交所,可以是列表,可空
    :param tradeDirection: 资金方向，NB-北向，SB-南向。香港交易者交易内地股票称为北向，内地投资者交易香港股票成为南向。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHKMktTuoRTSnapshot.csv?ispandas=1&') 
    requestString.append("connectMarket=")
    if hasattr(connectMarket,'__iter__') and not isinstance(connectMarket, str):
        if len(connectMarket) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = connectMarket
            requestString.append(None)
        else:
            requestString.append(','.join(connectMarket))
    else:
        requestString.append(connectMarket)
    requestString.append("&tradeDirection=")
    if hasattr(tradeDirection,'__iter__') and not isinstance(tradeDirection, str):
        if len(tradeDirection) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDirection
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDirection))
    else:
        requestString.append(tradeDirection)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKMktTuoRTSnapshotGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKMktTuoRTSnapshotGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'connectMarket', u'tradeDirection', u'buyTurnover', u'sellTurnover', u'totalTurnover', u'netTurnover']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','connectMarket': 'str','tradeDirection': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def HKMktTuoRTIntraDayGet(connectMarket = "", tradeDirection = "", startTime = "", endTime = "", field = "", pandas = "1"):
    """
    获取港股通南北向资金流向当日快照
    
    :param connectMarket: 交易关联市场，SH-上交所，SZ-深交所,可以是列表,connectMarket、tradeDirection至少选择一个
    :param tradeDirection: 交易方向，NB-北向，SB-南向,可以是列表,connectMarket、tradeDirection至少选择一个
    :param startTime: 开始时间，格式为HH:MM,可空
    :param endTime: 结束时间，格式为HH:MM,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market/getHKMktTuoRTIntraDay.csv?ispandas=1&') 
    requestString.append("connectMarket=")
    if hasattr(connectMarket,'__iter__') and not isinstance(connectMarket, str):
        if len(connectMarket) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = connectMarket
            requestString.append(None)
        else:
            requestString.append(','.join(connectMarket))
    else:
        requestString.append(connectMarket)
    requestString.append("&tradeDirection=")
    if hasattr(tradeDirection,'__iter__') and not isinstance(tradeDirection, str):
        if len(tradeDirection) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = tradeDirection
            requestString.append(None)
        else:
            requestString.append(','.join(tradeDirection))
    else:
        requestString.append(tradeDirection)
    if not isinstance(startTime, str) and not isinstance(startTime, unicode):
        startTime = str(startTime)

    requestString.append("&startTime=%s"%(startTime))
    if not isinstance(endTime, str) and not isinstance(endTime, unicode):
        endTime = str(endTime)

    requestString.append("&endTime=%s"%(endTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'HKMktTuoRTIntraDayGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'HKMktTuoRTIntraDayGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'dataDate', u'dataTime', u'connectMarket', u'tradeDirection', u'buyTurnover', u'sellTurnover', u'totalTurnover', u'netTurnover']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'dataDate': 'str','dataTime': 'str','connectMarket': 'str','tradeDirection': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoInfoGet(coinName = "", field = "", pandas = "1"):
    """
    获取数字货币基础信息，包含算法、验证方式、总供给量、货币描述等信息
    
    :param coinName: 数字货币名称,如: BTC,LTC,ETH等,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoInfo.csv?ispandas=1&') 
    requestString.append("coinName=")
    if hasattr(coinName,'__iter__') and not isinstance(coinName, str):
        if len(coinName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = coinName
            requestString.append(None)
        else:
            requestString.append(','.join(coinName))
    else:
        requestString.append(coinName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoInfoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoInfoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'coinName', u'secShortName', u'alogorithm', u'proofType', u'fullPremined', u'totalCoinSupply', u'description', u'features', u'technology', u'listDate', u'officialWebsite']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'coinName': 'str','secShortName': 'str','alogorithm': 'str','proofType': 'str','totalCoinSupply': 'str','description': 'str','features': 'str','technology': 'str','officialWebsite': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoStatusGet(coinName, tradeDate, barBeginTime = "", barEndTime = "", field = "", pandas = "1"):
    """
    获取数字货币状态信息，包含预警信息、公告信息、货币最近挖掘时间戳、当前区块数等信息，信息最多延迟一小时，若无状态更新，则该时点无数据返回
    
    :param coinName: 货币名称，可通过getCryptoInfo获取数字货币名称，如“BTC”--比特币，可多值输入,可以是列表
    :param tradeDate: 状态日期，如“YYYYMMDD”
    :param barBeginTime: 状态时间起始点，如“09:00”,可空
    :param barEndTime: 状态时间截止点，如“20:00”,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoStatus.csv?ispandas=1&') 
    requestString.append("coinName=")
    if hasattr(coinName,'__iter__') and not isinstance(coinName, str):
        if len(coinName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = coinName
            requestString.append(None)
        else:
            requestString.append(','.join(coinName))
    else:
        requestString.append(coinName)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    if not isinstance(barBeginTime, str) and not isinstance(barBeginTime, unicode):
        barBeginTime = str(barBeginTime)

    requestString.append("&barBeginTime=%s"%(barBeginTime))
    if not isinstance(barEndTime, str) and not isinstance(barEndTime, unicode):
        barEndTime = str(barEndTime)

    requestString.append("&barEndTime=%s"%(barEndTime))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoStatusGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoStatusGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'coinName', u'secShortName', u'tradeDate', u'barTime', u'dangerTop', u'warningTop', u'infoTop', u'lastExplorerTs', u'difficultyAdj', u'rewardReduction', u'blockNumber', u'blockTime', u'netHashesPs', u'totalCoinsMined', u'preTotalCoinsMined', u'blockReward']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'coinName': 'str','secShortName': 'str','barTime': 'str','dangerTop': 'str','warningTop': 'str','infoTop': 'str','lastExplorerTs': 'str','difficultyAdj': 'str','rewardReduction': 'str','blockNumber': 'str','blockTime': 'str','netHashesPs': 'str','totalCoinsMined': 'str','preTotalCoinsMined': 'str','blockReward': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoMinEqpGet(eqpName = "", eComPlat = "", coinName = "", field = "", pandas = "1"):
    """
    获取数字货币挖掘工具信息，包含挖掘工具名称，算法，每秒哈希次数，挖掘货币名称等信息。
    
    :param eqpName: 挖据工具名称,可空
    :param eComPlat: 挖据工具品牌或电商平台,可空
    :param coinName: 数字货币代码，如BTC,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoMinEqp.csv?ispandas=1&') 
    if not isinstance(eqpName, str) and not isinstance(eqpName, unicode):
        eqpName = str(eqpName)

    requestString.append("eqpName=%s"%(eqpName))
    if not isinstance(eComPlat, str) and not isinstance(eComPlat, unicode):
        eComPlat = str(eComPlat)

    requestString.append("&eComPlat=%s"%(eComPlat))
    if not isinstance(coinName, str) and not isinstance(coinName, unicode):
        coinName = str(coinName)

    requestString.append("&coinName=%s"%(coinName))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoMinEqpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoMinEqpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'eComPlat', u'eqpName', u'recommended', u'algorithm', u'hashPerSecond', u'eqpType', u'powerConsumption', u'coinName', u'coinShortName']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'eComPlat': 'str','eqpName': 'str','algorithm': 'str','hashPerSecond': 'str','coinName': 'str','coinShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoSocialHeatGet(coinName = "", platformType = "", tradeDate = "", field = "", pandas = "1"):
    """
    获取数字货币在各大社交平台，如Facebook、Twitter等每日的社交热度，包含点赞量、关注量、阅览量、点击量等等信息
    
    :param coinName: 数字货币代码，如BTC,coinName、platformType、tradeDate至少选择一个
    :param platformType: 社交平台类型，目前支持facebook、Twitter、Reddit和cryptoCompare,coinName、platformType、tradeDate至少选择一个
    :param tradeDate: 日期，格式为YYYYMMDD,coinName、platformType、tradeDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoSocialHeat.csv?ispandas=1&') 
    if not isinstance(coinName, str) and not isinstance(coinName, unicode):
        coinName = str(coinName)

    requestString.append("coinName=%s"%(coinName))
    if not isinstance(platformType, str) and not isinstance(platformType, unicode):
        platformType = str(platformType)

    requestString.append("&platformType=%s"%(platformType))
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoSocialHeatGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoSocialHeatGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'coinName', u'secShortName', u'platformType', u'tradeDate', u'followers', u'posts', u'comments', u'points', u'pageViewers', u'favourites', u'account_ct_date', u'accName', u'link', u'lists', u'commentsPerHour', u'commentsPerDay', u'postPerHour', u'postPerDay', u'activeUsers', u'talkAboutNum', u'isCloseed']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'coinName': 'str','secShortName': 'str','platformType': 'str','followers': 'str','posts': 'str','comments': 'str','points': 'str','pageViewers': 'str','favourites': 'str','accName': 'str','link': 'str','lists': 'str','commentsPerHour': 'str','commentsPerDay': 'str','postPerHour': 'str','postPerDay': 'str','activeUsers': 'str','talkAboutNum': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoCodeRepositoryGet(coinName = "", field = "", pandas = "1"):
    """
    获取数字货币代码信息，包括货币名称、货币简称、代码URL、代码仓库是否为克隆仓库、代码仓库大小(Byte)、用户、创建时间、编码语言、喜欢数、代码仓库总克隆数、代码仓库克隆开启数、代码仓库克隆完成数、代码仓库总开启问题数、代码仓库总关闭问题数、代码仓库开启问题数(未克隆)、代码仓库关闭问题数(未克隆)、代码最近提交时间、最后更新时间、父货币名称、父货币简称、父货币代码等信息。
    
    :param coinName: 货币名称,如“BTC”，可与数字货币基础信息getCryptoInfo)的货币名称字段关联。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoCodeRepository.csv?ispandas=1&') 
    requestString.append("coinName=")
    if hasattr(coinName,'__iter__') and not isinstance(coinName, str):
        if len(coinName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = coinName
            requestString.append(None)
        else:
            requestString.append(','.join(coinName))
    else:
        requestString.append(coinName)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoCodeRepositoryGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoCodeRepositoryGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'coinName', u'secShortName', u'codeUrl', u'isFork', u'size', u'subscribers', u'codeCtTime', u'language', u'stars', u'forksNum', u'openPullIssues', u'closedPullIssues', u'openTotalIssues', u'closedTotalIssues', u'openIssues', u'closedIssues', u'lastPush', u'lastUpdate', u'parCoinName', u'parSecShortName', u'parUrl']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'coinName': 'str','secShortName': 'str','codeUrl': 'str','language': 'str','parCoinName': 'str','parSecShortName': 'str','parUrl': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def FutuCryptoGet(secID = "", ticker = "", exchangeCD = "", field = "", pandas = "1"):
    """
    获取数字货币期货合约的基本要素信息，包括合约代码、合约类型、期货品种、报价单位、杠杆、期限、结算货币、行情精度、保证金比例等。
    
    :param secID: 证券内部编码，可通过交易代码和交易市场在DataAPI.SecIDGet获取到。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param ticker: 合约交易代码,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param exchangeCD: 通联编制的证券市场编码。例如，CPFI-Crypto Facilities；XCBO-芝加哥期权交易所；XCBT-芝加哥商品期货交易所等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可以是列表,secID、ticker、exchangeCD至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getFutuCrypto.csv?ispandas=1&') 
    requestString.append("secID=")
    if hasattr(secID,'__iter__') and not isinstance(secID, str):
        if len(secID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = secID
            requestString.append(None)
        else:
            requestString.append(','.join(secID))
    else:
        requestString.append(secID)
    requestString.append("&ticker=")
    if hasattr(ticker,'__iter__') and not isinstance(ticker, str):
        if len(ticker) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = ticker
            requestString.append(None)
        else:
            requestString.append(','.join(ticker))
    else:
        requestString.append(ticker)
    requestString.append("&exchangeCD=")
    if hasattr(exchangeCD,'__iter__') and not isinstance(exchangeCD, str):
        if len(exchangeCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = exchangeCD
            requestString.append(None)
        else:
            requestString.append(','.join(exchangeCD))
    else:
        requestString.append(exchangeCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'FutuCryptoGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'FutuCryptoGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'secID', u'ticker', u'secShortName', u'exchangeCd', u'contractType', u'contractObject', u'priceNum', u'priceUnit', u'leverage', u'maturities', u'marginSetCurrency', u'tickSizeNum', u'tickSizeUnit', u'marginRequire', u'deliYear', u'deliMonth', u'delistDate', u'deliMethod', u'remark', u'quoteCurrency', u'contMultiUnit']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'secID': 'str','ticker': 'str','secShortName': 'str','exchangeCd': 'str','contractType': 'str','contractObject': 'str','priceUnit': 'str','leverage': 'str','maturities': 'str','marginSetCurrency': 'str','tickSizeNum': 'str','tickSizeUnit': 'str','marginRequire': 'str','deliMethod': 'str','remark': 'str','quoteCurrency': 'str','contMultiUnit': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoCapdGet(coinName, beginDate = "", endDate = "", field = "", pandas = "1"):
    """
    获取数字货币每日市值信息
    
    :param coinName: 货币名称，可通过getCryptoInfo获取数字货币名称，如“BTC”--比特币，可多值输入,可以是列表
    :param beginDate: 查询起始日期，格式为YYYYMMDD,可空
    :param endDate: 查询结束日期，格式为YYYYMMDD,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoCapd.csv?ispandas=1&') 
    requestString.append("coinName=")
    if hasattr(coinName,'__iter__') and not isinstance(coinName, str):
        if len(coinName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = coinName
            requestString.append(None)
        else:
            requestString.append(','.join(coinName))
    else:
        requestString.append(coinName)
    try:
        beginDate = beginDate.strftime('%Y%m%d')
    except:
        beginDate = beginDate.replace('-', '')
    requestString.append("&beginDate=%s"%(beginDate))
    try:
        endDate = endDate.strftime('%Y%m%d')
    except:
        endDate = endDate.replace('-', '')
    requestString.append("&endDate=%s"%(endDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoCapdGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoCapdGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'coinName', u'secShortName', u'tradeDate', u'marketCpt']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'coinName': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def CryptoOnChainStatsGet(coinName = "", tradeDate = "", field = "", pandas = "1"):
    """
    获取数字货币链上统计数据，包括预估交易量、预估交易笔数、市值、价格、交易市场成交量、新增货币数量、交易费用、活跃地址数量等。
    
    :param coinName: 数字货币名称,如BTC,LTC等,可以是列表,coinName、tradeDate至少选择一个
    :param tradeDate: 日期,coinName、tradeDate至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/crypto/getCryptoOnChainStats.csv?ispandas=1&') 
    requestString.append("coinName=")
    if hasattr(coinName,'__iter__') and not isinstance(coinName, str):
        if len(coinName) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = coinName
            requestString.append(None)
        else:
            requestString.append(','.join(coinName))
    else:
        requestString.append(coinName)
    try:
        tradeDate = tradeDate.strftime('%Y%m%d')
    except:
        tradeDate = tradeDate.replace('-', '')
    requestString.append("&tradeDate=%s"%(tradeDate))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, 'CryptoOnChainStatsGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, 'CryptoOnChainStatsGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'coinName', u'secShortName', u'tradeDate', u'volumeUSD', u'deal', u'actAddress', u'marketCPT', u'price', u'exVolume', u'genCoins', u'fee']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'coinName': 'str','secShortName': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ApiNaviRrpGet(naviID = "", level = "", field = "", pandas = "1"):
    """
    获取API导航信息。
    
    :param naviID: 导航ID，例如100002001，表示沪深股票发行统计。,可以是列表,可空
    :param level: 层级,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/rrpFolder/getApiNaviRrp.csv?ispandas=1&') 
    requestString.append("naviID=")
    if hasattr(naviID,'__iter__') and not isinstance(naviID, str):
        if len(naviID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = naviID
            requestString.append(None)
        else:
            requestString.append(','.join(naviID))
    else:
        requestString.append(naviID)
    requestString.append("&level=")
    if hasattr(level,'__iter__') and not isinstance(level, str):
        if len(level) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = level
            requestString.append(None)
        else:
            requestString.append(','.join(level))
    else:
        requestString.append(level)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ApiNaviRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ApiNaviRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'naviID', u'naviName', u'naviNameEN', u'parentID', u'displayOrder', u'isPub', u'level', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'naviName': 'str','naviNameEN': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ApiNaviRelRrpGet(comment = "", parentID = "", apiID = "", naviID = "", field = "", pandas = "1"):
    """
    获取API与导航的关联信息。
    
    :param comment: API说明,可空
    :param parentID: 导航父节点ID,可以是列表,可空
    :param apiID: API ID,可以是列表,可空
    :param naviID: 导航ID，例如100002001，表示沪深股票发行统计。,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/rrpFolder/getApiNaviRelRrp.csv?ispandas=1&') 
    if not isinstance(comment, str) and not isinstance(comment, unicode):
        comment = str(comment)

    requestString.append("comment=%s"%(comment))
    requestString.append("&parentID=")
    if hasattr(parentID,'__iter__') and not isinstance(parentID, str):
        if len(parentID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = parentID
            requestString.append(None)
        else:
            requestString.append(','.join(parentID))
    else:
        requestString.append(parentID)
    requestString.append("&apiID=")
    if hasattr(apiID,'__iter__') and not isinstance(apiID, str):
        if len(apiID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = apiID
            requestString.append(None)
        else:
            requestString.append(','.join(apiID))
    else:
        requestString.append(apiID)
    requestString.append("&naviID=")
    if hasattr(naviID,'__iter__') and not isinstance(naviID, str):
        if len(naviID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = naviID
            requestString.append(None)
        else:
            requestString.append(','.join(naviID))
    else:
        requestString.append(naviID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ApiNaviRelRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ApiNaviRelRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'apiID', u'name', u'comment', u'commentEN', u'naviID', u'usageExample', u'displayOrder', u'isExe', u'updateTime', u'parentID']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name': 'str','comment': 'str','commentEN': 'str','usageExample': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __ApiRelRrpGet(apiID = "", relApiID = "", field = "", pandas = "1"):
    """
    API与API关联关系（萝卜用）。
    
    :param apiID: API ID,可以是列表,apiID、relApiID至少选择一个
    :param relApiID: 关联API ID,可以是列表,apiID、relApiID至少选择一个
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/rrpFolder/getApiRelRrp.csv?ispandas=1&') 
    requestString.append("apiID=")
    if hasattr(apiID,'__iter__') and not isinstance(apiID, str):
        if len(apiID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = apiID
            requestString.append(None)
        else:
            requestString.append(','.join(apiID))
    else:
        requestString.append(apiID)
    requestString.append("&relApiID=")
    if hasattr(relApiID,'__iter__') and not isinstance(relApiID, str):
        if len(relApiID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = relApiID
            requestString.append(None)
        else:
            requestString.append(','.join(relApiID))
    else:
        requestString.append(relApiID)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__ApiRelRrpGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__ApiRelRrpGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'apiID', u'paramID1', u'name1', u'paramID2', u'name2', u'paramID3', u'name3', u'relApiID', u'relParamID1', u'relName1', u'relParamID2', u'relName2', u'relParamID3', u'relName3', u'updateTime']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'name1': 'str','name2': 'str','name3': 'str','relName1': 'str','relName2': 'str','relName3': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __RrpSysCodeGet(apiID, paramID, useType, codeTypeID = "", valueCD = "", field = "", pandas = "1"):
    """
    萝卜所用api涉及的参数常量表
    
    :param apiID: API接口ID,可以是列表
    :param paramID: 参数ID,可以是列表
    :param useType: 应用参数类型，有“VALUE_NUM_CD”“VALUE_EN_CD”“VALUE_NO”三种,可以是列表
    :param codeTypeID: 分类类型代码,可以是列表,可空
    :param valueCD: 参数值代码,可以是列表,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/rrpFolder/getRrpSysCode.csv?ispandas=1&') 
    requestString.append("apiID=")
    if hasattr(apiID,'__iter__') and not isinstance(apiID, str):
        if len(apiID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = apiID
            requestString.append(None)
        else:
            requestString.append(','.join(apiID))
    else:
        requestString.append(apiID)
    requestString.append("&paramID=")
    if hasattr(paramID,'__iter__') and not isinstance(paramID, str):
        if len(paramID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = paramID
            requestString.append(None)
        else:
            requestString.append(','.join(paramID))
    else:
        requestString.append(paramID)
    requestString.append("&useType=")
    if hasattr(useType,'__iter__') and not isinstance(useType, str):
        if len(useType) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = useType
            requestString.append(None)
        else:
            requestString.append(','.join(useType))
    else:
        requestString.append(useType)
    requestString.append("&codeTypeID=")
    if hasattr(codeTypeID,'__iter__') and not isinstance(codeTypeID, str):
        if len(codeTypeID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = codeTypeID
            requestString.append(None)
        else:
            requestString.append(','.join(codeTypeID))
    else:
        requestString.append(codeTypeID)
    requestString.append("&valueCD=")
    if hasattr(valueCD,'__iter__') and not isinstance(valueCD, str):
        if len(valueCD) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = valueCD
            requestString.append(None)
        else:
            requestString.append(','.join(valueCD))
    else:
        requestString.append(valueCD)
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__RrpSysCodeGet')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__RrpSysCodeGet')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'apiID', u'paramID', u'codeTypeID', u'codeTypeName', u'useType', u'valueCD', u'valueNameCn', u'valueNameEn', u'remark']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'codeTypeName': 'str','useType': 'str','valueCD': 'str','valueNameCn': 'str','valueNameEn': 'str','remark': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

def __TickRTSnapshotL2Get(securityID = "", exchangeCD = "", field = "", pandas = "1"):
    """
    高频数据，获取一只证券当日内时间段的Level2信息。 证券可以是股票，指数， 部分债券或 基金，包含买卖10档行情、成交笔数、委买卖总量，IOPV等
    
    :param securityID: 一只或多只证券代码，用,分隔，格式是“数字.交易所代码”，如000001.XSHG。如果为空，则为全部证券。,可以是列表,可空
    :param exchangeCD: 通联编制的证券市场编码。例如，XSHG-上海证券交易所；XSHE-深圳证券交易所；XIBE-中国银行间市场等。对应DataAPI.SysCodeGet.codeTypeID=10002。,可空
    :param field: 所需字段,可以是列表,可空
    :param pandas: 1表示返回 pandas data frame，0表示返回csv,可空
    :return: :raise e: API查询的结果，是CSV或者被转成pandas data frame；若查询API失败，返回空data frame； 若解析失败，则抛出异常
    """
        
    pretty_traceback()
    frame = inspect.currentframe()
    func_name, cache_key = get_cache_key(frame)
    cache_result = get_data_from_cache(func_name, cache_key)
    if cache_result is not None:
        return cache_result
    split_index = None
    split_param = None
    httpClient = api_base.__getConn__()    
    requestString = []
    requestString.append('/api/market2/getTickRTSnapshotL2.csv?ispandas=1&') 
    requestString.append("securityID=")
    if hasattr(securityID,'__iter__') and not isinstance(securityID, str):
        if len(securityID) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = securityID
            requestString.append(None)
        else:
            requestString.append(','.join(securityID))
    else:
        requestString.append(securityID)
    if not isinstance(exchangeCD, str) and not isinstance(exchangeCD, unicode):
        exchangeCD = str(exchangeCD)

    requestString.append("&exchangeCD=%s"%(exchangeCD))
    requestString.append("&field=")
    if hasattr(field,'__iter__') and not isinstance(field, str):
        if len(field) > 100 and split_param is None:
            split_index = len(requestString)
            split_param = field
            requestString.append(None)
        else:
            requestString.append(','.join(field))
    else:
        requestString.append(field)
    if split_param is None:
        csvString = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
        if csvString is None or len(csvString) == 0 or (csvString[0] == '-' and not api_base.is_no_data_warn(csvString, False)) or csvString[0] == '{':
            api_base.handle_error(csvString, '__TickRTSnapshotL2Get')
        elif csvString[:2] == '-1':
            csvString = ''
    else:
        p_list = api_base.splist(split_param, 100)
        csvString = []
        for index, item in enumerate(p_list):
            requestString[split_index] = ','.join(item)
            temp_result = api_base.__getCSV__(''.join(requestString), httpClient, gw=True)
            if temp_result is None or len(temp_result) == 0 or temp_result[0] == '{' or (temp_result[0] == '-' and not api_base.is_no_data_warn(temp_result, False)):
                api_base.handle_error(temp_result, '__TickRTSnapshotL2Get')
            if temp_result[:2] != '-1':
                csvString.append(temp_result if len(csvString) == 0 else temp_result[temp_result.find('\n')+1:])
        csvString = ''.join(csvString)
    
    if len(csvString) == 0:
        if 'field' not in locals() or len(field) == 0:
            field = [u'exchangeCD', u'ticker', u'timestamp', u'askBook', u'bidBook', u'closePrice', u'currencyCD', u'dataDate', u'dataTime', u'highPrice', u'IOPV', u'lastPrice', u'localTimestamp', u'lowPrice', u'openPrice', u'prevClosePrice', u'suspension', u'totalAskVolume', u'totalBidVolume', u'tradeNumber', u'utcOffset', u'value', u'volume', u'weightedAvgAskPrice', u'weightedAvgBidPrice', u'shortNM']
        if hasattr(field, '__iter__') and not isinstance(field, str):
            csvString = ','.join(field) + '\n'
        else:
            csvString = field + '\n'
    if pandas != "1":
        put_data_in_cache(func_name, cache_key, csvString)
        return csvString
    try:
        myIO = StringIO(csvString)
        pdFrame = pd.read_csv(myIO, dtype = {'exchangeCD': 'str','ticker': 'str','askBook': 'str','bidBook': 'str','currencyCD': 'str','dataDate': 'str','dataTime': 'str','utcOffset': 'str','shortNM': 'str'},  )
        put_data_in_cache(func_name, cache_key, pdFrame)
        return pdFrame
    except Exception as e:
        raise e
    finally:
        myIO.close()

